大家帮忙看一个C语言小程序,报错expression syntax in function main

题目是求任意个数数字平均值的。从键盘输入数字,判断是否再次输入,直到不再输入时,计算已输入所有数字的平均值。代码如下
#include <stdio.h>
#include <ctype.h> //为了使用tolower()
int main(void)
{
char answer='N';
double value=0.0;
double total=0.0;
int count=0;
printf("\nthis program calculates the average of any number of values.");
for(,,) //
{
printf("\nplease input a value:");
scanf(" %lf",&value);
total+=value;
++count;
printf("Do you want to input another value ?(Y or N): ");
scanf(" %c",&answer);
if(tolower(answer)=='n')
break;
}
printf("The average of these values is %0.2lf\n",total/count);
getch();
return 0;
}

for(;;) 是分号,不是逗号。
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答
大家正在搜