文件名称:dayin
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:9.55kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
编写螺旋方阵。其中螺旋方阵形式如下:
1 12 11 10
2 13 16 9
3 14 15 8
4 5 6 7
设row,column分别代表行、列坐标,变量p从1到n2将p依次存入数组a[row][column]中,要确定row、colomn的变化情况。分析如下:引进变量k,初值为n。当数据存入到左下角或右上角时,k减1,这样可保证输出时方阵。引进变量t,初值为1,当数据存入到右下角时,令t改变符合,当存入到左上角时,t又改变符合,这样可保证赋值到正确的数组坐标。
-Write spiral square. Square spiral form which is as follows: 1 12 1,110,213,169,314,158,456 7 set row, column representing the row, column coordinates, the variable p p from 1 to n2 will turn into an array a [row] [column], we must determine the row, colomn changes. As follows: the introduction of variable k, the initial value is n. When the data stored in the lower left or upper right corner when, k by 1, it will ensure that the output matrix. The introduction of variable t, the initial value is 1, when the data stored in the lower right corner, have resulted in changes consistent with t, the time when the deposit to the upper left corner, t and changing the match, it will ensure that the correct assignment to the array of coordinates.
1 12 11 10
2 13 16 9
3 14 15 8
4 5 6 7
设row,column分别代表行、列坐标,变量p从1到n2将p依次存入数组a[row][column]中,要确定row、colomn的变化情况。分析如下:引进变量k,初值为n。当数据存入到左下角或右上角时,k减1,这样可保证输出时方阵。引进变量t,初值为1,当数据存入到右下角时,令t改变符合,当存入到左上角时,t又改变符合,这样可保证赋值到正确的数组坐标。
-Write spiral square. Square spiral form which is as follows: 1 12 1,110,213,169,314,158,456 7 set row, column representing the row, column coordinates, the variable p p from 1 to n2 will turn into an array a [row] [column], we must determine the row, colomn changes. As follows: the introduction of variable k, the initial value is n. When the data stored in the lower left or upper right corner when, k by 1, it will ensure that the output matrix. The introduction of variable t, the initial value is 1, when the data stored in the lower right corner, have resulted in changes consistent with t, the time when the deposit to the upper left corner, t and changing the match, it will ensure that the correct assignment to the array of coordinates.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
打印旋转方阵/3_19.cpp
打印旋转方阵/3_19.dsp
打印旋转方阵/3_19.dsw
打印旋转方阵/3_19.ncb
打印旋转方阵/3_19.opt
打印旋转方阵/3_19.plg
打印旋转方阵/编写螺旋方阵.doc
打印旋转方阵
打印旋转方阵/3_19.dsp
打印旋转方阵/3_19.dsw
打印旋转方阵/3_19.ncb
打印旋转方阵/3_19.opt
打印旋转方阵/3_19.plg
打印旋转方阵/编写螺旋方阵.doc
打印旋转方阵
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.