#include <stdio.h>
int main(int argc, const char * argv[]) {
// insert code here…
int a[3][5],i,j,(p)[5];
p=&a[0];
printf(“please input:\n”);
for (i=0; i<3; i++) {
for (j=0; j<5; j++) {
scanf("%d",((p+i))+j);
}
}
p=&a[2]; //p为第一个元素的地址
printf(“the third line is:\n”);
for (j=0; j<5; j++) {
printf("%5d",*((*p)+j));
}
printf("\n");
return 0;
}
输出结果:
please input:
1 2 3 4 5
6 7 8 9 10
11 22 33 44 55
the third line is:
11 22 33 44 55
Program ended with exit code: 0