J
John
Dear experts,
I selected this problem among off messages of this page:
a[1] to a[9].
I tried as I was able,but the output of my solution is not satisfying
the said matter in the problem.if possible,please show the correct
method.thank you!
The solution is as follows:
#include <stdio.h>
int main()
{
int a[10][10];
int i,j,k;
int x;
for(i=0; i<10; i++){
for(j=0; j<10; j++) a[j]=j+1;
}
for(i=0; i<10; i++){
for(j=0; j<10; j++){
x= a[j];
a[j]=a[j];
a[j]=x;
for(k=0; k<10; k++)printf("%d", a[j][k]);
printf("\n");
}
printf("\n");
}
return 0;
}
I selected this problem among off messages of this page:
specified by an integer sequence about 9 times, store >the results fromDaclare a two-dimensional array of size 10 by 10 and read 10
integers into a[0][0] to a[0][9].then repeat the insertion >operation
a[1] to a[9].
Finally,print the array.
I tried as I was able,but the output of my solution is not satisfying
the said matter in the problem.if possible,please show the correct
method.thank you!
The solution is as follows:
#include <stdio.h>
int main()
{
int a[10][10];
int i,j,k;
int x;
for(i=0; i<10; i++){
for(j=0; j<10; j++) a[j]=j+1;
}
for(i=0; i<10; i++){
for(j=0; j<10; j++){
x= a[j];
a[j]=a[j];
a[j]=x;
for(k=0; k<10; k++)printf("%d", a[j][k]);
printf("\n");
}
printf("\n");
}
return 0;
}