数据结构
来源:互联网 发布:同步带选型软件 编辑:程序博客网 时间:2024/06/05 12:03
2 38 65 64 63 62 61 60 59 27
3 39 67 86 85 84 83 82 58 26
4 40 68 88 99 98 97 81 57 25
5 41 69 89 101 104 96 80 56 24
6 42 70 90 102 103 95 79 55 23
7 43 71 91 92 93 94 78 54 22
8 44 72 73 74 75 76 77 53 21
9 45 46 47 48 49 50 51 52 20
10 11 12 13 14 15 16 17 18 19
java程序打印出来
public class TestDS {
public static void main(String[] args) {
int cloumn =20 ,row = 10 ;
int startCloumn = 0 , endCloumn = 0, startRow = 0 , endRow = 0 ;
int count =row*cloumn;
int j = 0 ;
int arr[][] = new int[row][cloumn];
endCloumn = cloumn-1;
endRow = row -1;
for(int i = 1 ;i < count ;i++){
for(j =startRow;j<=endRow ;j++ ){
arr[j][startCloumn]= i;
i++;
}
startCloumn++;
for(j = startCloumn ; j<=endCloumn; j++){
arr[endRow][j] = i ;
i++;
}
endRow-- ;
for(j =endRow;j>=startRow ;j--){
arr[j][endCloumn]= i;
i++;
}
endCloumn--;
for(j = endCloumn ; j>=startCloumn; j--){
System.out.println(j+","+startRow);
arr[startRow][j] = i ;
i++;
}
startRow ++;
}
for(int i = 0 ;i <row ;i++){
for(j=0 ;j<cloumn ;j++){
System.out.print(arr[i][j]+" ");
if(arr[i][j]<10)
System.out.print(" ");
else if(arr[i][j]<100)
System.out.print(" ");
}
System.out.println();
}
}
}
- 数据结构
- 数据结构
- 数据结构
- 数据结构
- 数据结构
- 数据结构
- 数据结构
- 数据结构
- 数据结构
- 数据结构
- 数据结构
- 数据结构
- 数据结构
- 数据结构
- 数据结构
- 数据结构
- 数据结构
- 数据结构
- 经典排序算法之实现(七)
- 注册DLL文件命令的使用方法详细说明
- VC++ 获取文件夹路径
- objective-c-json-js
- 详解Linux下SSH远程文件传输命令scp
- 数据结构
- 输入十进制数,输出其相对应的16进制数。
- CTime,COleDateTime,SYSTEMTIME
- 四个排名函数(row_number、rank、dense_rank和ntile)的比较
- 不编程的架构师的职业生涯是短暂的
- create view过程中遇到的ora-01031、ORA-00998错误
- Poj 1328 贪心
- Linux多线程编程(不限Linux)
- android多国语言文件夹