文件名称:mian
- 所属分类:
- 数据结构常用算法
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 170kb
- 下载次数:
- 0次
- 提 供 者:
- 莫*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
幻方矩阵
问题描述:
幻方是一种很有意思的数字矩阵,在很早著名的九宫八卦阵就与幻方有关。
幻方的定义为:
1 到 N*N 的整数填入N*N的方格中,每行和每列以及对角线的数字之和必须是相等的。
你作为八卦公司的顶级程序员,现在需要你解决一个问题,将任意奇数阶的幻方找出来。
输入:
输入包括多个测试集,每行为一个正奇数N(1 <= N < 1000),0作为输入的结束且不需要处理。
输出:
对于输入的每一个N, 输出一个它所对应的N阶幻方,如果存在多个,任意一个即可。
每个幻方为N*N的矩阵,
对于每个幻方,每行输出幻方的一行,每行中的数字之间用一个或多个空格分开。不同的幻方之间用一个空行分开。-Magic square matrices
Problem Descr iption:
The Magic Quadrant is a very interesting digital matrix, Bagua Zhen Jiu Gong in early on with the famous magic square related.
Magic square is defined as:
1 to N* N N* N integer fill the grid, each row and column and diagonal sum of the numbers must be equal.
Your company s top programmers as gossip, you now need to solve a problem, any odd-order magic square to find out.
Input:
Input consists of multiple test sets, each act a positive odd N (1 <= N <1000), 0 end as input and does not require treatment.
Output:
For each input N, it corresponds to the output of a magic square of order N, if there is more than one, any one can.
Every magic square is N* N matrix,
For each magic square, magic square of each line of output line between the numbers in each row with one or more separated by spaces. Between the different magic squares separated by a blank line.
问题描述:
幻方是一种很有意思的数字矩阵,在很早著名的九宫八卦阵就与幻方有关。
幻方的定义为:
1 到 N*N 的整数填入N*N的方格中,每行和每列以及对角线的数字之和必须是相等的。
你作为八卦公司的顶级程序员,现在需要你解决一个问题,将任意奇数阶的幻方找出来。
输入:
输入包括多个测试集,每行为一个正奇数N(1 <= N < 1000),0作为输入的结束且不需要处理。
输出:
对于输入的每一个N, 输出一个它所对应的N阶幻方,如果存在多个,任意一个即可。
每个幻方为N*N的矩阵,
对于每个幻方,每行输出幻方的一行,每行中的数字之间用一个或多个空格分开。不同的幻方之间用一个空行分开。-Magic square matrices
Problem Descr iption:
The Magic Quadrant is a very interesting digital matrix, Bagua Zhen Jiu Gong in early on with the famous magic square related.
Magic square is defined as:
1 to N* N N* N integer fill the grid, each row and column and diagonal sum of the numbers must be equal.
Your company s top programmers as gossip, you now need to solve a problem, any odd-order magic square to find out.
Input:
Input consists of multiple test sets, each act a positive odd N (1 <= N <1000), 0 end as input and does not require treatment.
Output:
For each input N, it corresponds to the output of a magic square of order N, if there is more than one, any one can.
Every magic square is N* N matrix,
For each magic square, magic square of each line of output line between the numbers in each row with one or more separated by spaces. Between the different magic squares separated by a blank line.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
mian\Debug\mian.exe
....\.....\mian.ilk
....\.....\mian.obj
....\.....\mian.pch
....\.....\mian.pdb
....\.....\vc60.idb
....\.....\vc60.pdb
....\mian.cpp
....\mian.dsp
....\mian.dsw
....\mian.ncb
....\mian.opt
....\mian.plg
....\Debug
mian
....\.....\mian.ilk
....\.....\mian.obj
....\.....\mian.pch
....\.....\mian.pdb
....\.....\vc60.idb
....\.....\vc60.pdb
....\mian.cpp
....\mian.dsp
....\mian.dsw
....\mian.ncb
....\mian.opt
....\mian.plg
....\Debug
mian