把8个整数读入一个数组,哪边出错了?
#include <stdio.h>int main(void)
{
int integer[8];
int i;
printf("输入8个整数: \n");
scanf("%d", &integer[8]);
for(i = 8; i > 0; i--)
printf("%d ", integer[i]);
printf("\n");
return 0;
}
输出结果是
输入8个整数:
1 2 3 4 5 6 7 8
1 0 0 0 0 0 0 0
Program ended with exit code: 0