回复 4楼 yuccn
#include<stdio.h>
int main()
{
int a[70],i=0,j;
int sum=0;
char y;
printf("please the numbers and please the enter to sum up\n");
do
{
scanf("%d",&a[i++]);
}while((y=getchar()) != '\n');
for(j=0;j<i;j++)
sum += a[j];
printf(" %d numbers you have entered and the sum is
= %d \n", i,sum);
return 0;
}
这个是之前做过的一个,但是就是不懂如何加入一个条件,把字母等非数值参数忽略掉