标签:blog io for 2014 c++ log file c
/* Note:Your choice is C IDE */ #include "stdio.h" #include<stdlib.h> #include<time.h> #define N 4 void main() { int a[N][N]; int b[N][N]; int z,x,c,d,p,i,j; for(c=0;c<N;c++) srand(time(0)); a[0][c]=rand()%10; printf("\n\n"); d=0,p=0; do { for (z=d;z<N;z++){ a[d][z]=a[0][p]; a[z][d]=a[0][p]; p++; } d++; } while (d!=N); for (x=0;x<N;x++){ for (c=0;c<N;c++){ printf ("%d ",a[x][c]);} printf ("\n");} for(c=0;c<N;c++) srand(time(0)); a[0][c]=rand()%10; printf("\n\n"); d=0,p=0; do { for (z=d;z<N;z++){ a[d][z]=a[0][p]; a[z][d]=a[0][p]; p++; } d++; } while (d!=N); for (x=0;x<N;x++){ for (c=0;c<N;c++){ printf ("%d ",a[x][c]);} printf ("\n\n");} for(i=0;i<N;i++) { for(j=0;j<N;j++) { b[i][j]=a[i][j]+a[i][j]; printf("%2d ",b[i][j]); } printf("\n\n"); } }
标签:blog io for 2014 c++ log file c
原文地址:http://blog.csdn.net/u013116579/article/details/38340107