7-9
2013-10-08 01:03
134 查看
#include<stdio.h> int main(void) { int i,j,n,temp; int a[6][6]; printf("Enter n:"); scanf("%d",&n); for(i=0;i<n;i++) for(j=0;j<n;j++) a[i][j]=i*n+j+1; for(i=0;i<n;i++) for(j=0;j<n;j++) if(i<=j){ temp=a[i][j]; a[i][j]=a[j][i]; a[j][i]=temp; } for(i=0;i<n;i++){ for(j=0;j<n;j++) printf("%4d",a[i][j]); printf("\n"); } return 0; }
相关文章推荐
- 7-8
- PHP5.4 如何连接MS Sql Server
- hdu 4686 Arc of Dream 矩阵快速幂
- 7-7
- 《Effective C++(第三版)》-笔记
- 复合数据类型(三)
- makefile中使用echo -e引发的思考(涉及dash和bash)
- cxGrid动态设置单元格对齐方式
- RHEL5下 构建DHCP及中继服务器
- hdu3722Card Game(KM最大带权匹配)
- 【Deep Learning学习笔记】Dynamic Auto-Encoders for Semantic Indexing_Mirowski_NIPS2010
- 如何成为以业务为核心的行业专家--海纳百川,兼收并蓄
- vc中Error spawning cl.exe错误的解决方法.
- 问题解决:Linux 下使用 FileZilla 打开 Ftp 部分目录消失
- WEB网站服务--Apache
- C#_datatable 写入大量数据_BulkCopy
- 【leetcode】Roman to Integer
- C#_datatable_读取
- 5,6章
- UVA 10405 Longest Common Subsequence