第12.3小节代码 数列反向改进版
//This is a comment
//Author:King
//Time:2020/12/7
//Reference:C Programming:A Modern Approach,Second Edition
/***************************************************************
12.3小节代码 数列反向改进版
****************************************************************/
#include <stdio.h>
#define N 10;
int main(void)
{
int a[N], *p;
printf("Enter %d numbers:",N);
for(p = a; p < a + N; p++)
{
scanf("%d",p);
}
printf("In reverse order:");
for(p = a+N-1; p >= a; p--)
printf(" %d",*p);
printf("\n");
system("pause"); //加入该函数后可以使得产生的exe单独运行,不会发生闪退。也可以加入其它函数使得main函数无法返回即可。如while(1)、getchar() 等
return 0;
}