循环输入时好像还有点没达到要求,还要再做修改
// 6.16.14
#include <stdio.h>
int main(void)
{
double arrayone[8];
double arraytwo[8];
int loop;
for (loop = 0; loop < 8; loop++)
{
printf("请输入第%d个值:", loop + 1);
scanf("%lf", &arrayone[loop]);
}
for (loop = 0; loop < 8; loop++)
{
printf("%9f ", arrayone[loop]);
}
printf("
");
for (loop = 1; loop < 8; loop++)
{
arraytwo[0] = arrayone[0];
arraytwo[loop] = arraytwo[loop - 1] + arrayone[loop];
}
for (loop = 0; loop < 8; loop++)
{
printf("%9f ", arraytwo[loop]);
}
return 0;
}