Problem A: 逆序输出数列
#include<stdio.h> int main(void) { int n,i,a[100]; while(scanf("%d ",&n)!=EOF) { n>=1&&n<=100; for(i=1;i<=n;i++) scanf("%d",&a[i]); { for(i=n;i>=1;i--) printf("%d ",a[i]); printf("\n"); } } printf("\n"); return 0; }
#include<stdio.h> int main(void) { int n,i,a[100]; while(scanf("%d ",&n)!=EOF) { n>=1&&n<=100; for(i=1;i<=n;i++) scanf("%d",&a[i]); { for(i=n;i>=1;i--) printf("%d ",a[i]); printf("\n"); } } printf("\n"); return 0; }