我用的是dev++编写的,运行出错,不能按我想的输入5次,或是输入小于0的数就退出,而且提示我说是病毒??我晕啊,这段代码到底哪里出了问题啊??????
/*break语句,联系2017年5月23日 09:07:54*/
#include
main()
{
int numTest;
float stTest, avg, total =0.0;
for (numTest = 0; numTest < 5; numTest++)
{printf("What is the next student's test score?\n");
scanf(" %f ", &stTest);
if(stTest < 0.0);
{ break;}
total = total + stTest;
}
avg = total / numTest;
printf("\nThe average is %.1f\n",avg);
return 0;
}