c语言,从键盘输入若干个整数,用-1作为输入结束的标志,求他们的和及平均值

问题描述:

c语言,从键盘输入若干个整数,用-1作为输入结束的标志,求他们的和及平均值

#include
int main(void)
{
int count=0, n, sum=0;
whlie(scanf("%d",&n)!=EOF)
{
if(n==-1)
break;
else sum+=n;
count++
}
printf("%d, %lf\n", sum, sum*1.0/count);
return 0;
}怎么无法运行啊。。。#includeint main(void){int count=0, n, sum=0;while(scanf("%d",&n)!=EOF){if(n==-1)break;else sum+=n;count++;}printf("%d, %lf\n", sum, sum*1.0/count);return 0;}失误,这个是调试过得刚刚是怎么错的啊?whlie单词写错count++没加分号