程序代码:
# include <stdio.h> int main(void) { int a[10],i,temp; printf("please enter ten nums :\n"); for(i=0; i<10; i++) scanf("%d",&a[i]); for(i=0; i<5; i++) { temp=a[i]; a[i]=a[9-i]; a[9-i]=temp; } for(i=0; i<10; i++) printf("a[%d] = %d\n", i, a[i]); return 0; }