标签:c语言 lease int i++ ever ret print div 语言
1、
#include <stdio.h>
#define NUMBER 5
int main(void)
{
int a[NUMBER];
int i;
puts("please input several numbers.");
for (i = 0; i < NUMBER; i++)
{
printf("%dst = ", i + 1);
scanf("%d", &a[i]);
}
puts("-----\n-----\n-----");
int temp;
for (i = 0; i < NUMBER/2; i++)
{
temp = a[i];
a[i] = a[NUMBER-1-i];
a[NUMBER-1-i] = temp;
}
for (i = 0; i < NUMBER; i++)
printf("a[%d] = %d\n", i, a[i]);
return 0;
}
2、
#include <stdio.h>
#define NUMBER 8
int main(void)
{
int a[NUMBER];
int i;
puts("please input several numbers.");
for (i = 0; i < NUMBER; i++)
{
printf("%dst = ", i + 1);
scanf("%d", &a[i]);
}
puts("-----\n-----\n-----");
int temp;
for (i = 0; i < NUMBER/2; i++)
{
temp = a[i];
a[i] = a[NUMBER-1-i];
a[NUMBER-1-i] = temp;
}
for (i = 0; i < NUMBER; i++)
printf("a[%d] = %d\n", i, a[i]);
return 0;
}
标签:c语言 lease int i++ ever ret print div 语言
原文地址:https://www.cnblogs.com/liujiaxin2018/p/14370466.html