调试的时候,说是break不能用于这个地方,只能是循环或switch,我这个难道不是for 循环吗?望大神指导
#include <stdio.h>#define SUM 100000
int main ()
{
int i;
float amount,aver,total;
for (i=1,total=0;i<=1000;i++);
{
printf("please enter amount");
scanf("%f",amount);
total=total+amount;
if(total>SUM) break;
}
aver=total/i;
printf ("num=%d\naver=%10.2f\n",i,aver);
return 0;
}