#define N 10 main() { int a[N]={1,2,3,4,5,6,7,8,9,10} int i,j,t; printf("Before:\n"); for(i=0;i<=N-1;i++) printf("%4d",a[i]); printf("\n"); for (i=0,j=N-1;i<j;i++,j--) { t=a[i]; a[i]=a[j]; a[j]=t; } printf("After:\n"); for(i=0;i<=N-1;i++) printf("%4d",a[i]); printf("\n"); }请帮忙找一下错误吧!谢谢了!
#include <stdio.h>#define N 10 main() { int a[N]={1,2,3,4,5,6,7,8,9,10}; int i,j,t; printf("Before:\n"); for(i=0;i<=N-1;i++) printf("%4d",a[i]); printf("\n"); for (i=0,j=N-1;i<j;i++,j--) { t=a[i]; a[i]=a[j]; a[j]=t; } printf("After:\n"); for(i=0;i<=N-1;i++) printf("%4d",a[i]); printf("\n");} 加个头包含文件,以及在数组定义后面少‘;’号