#include <stdio.h>
int main()
{
int numTest;
float stTest, avg, total = 0.0;
for (numTest = 0; numTest < 25; numTest++)
{
printf("/nWhat is the next student's test score? ");
scanf(" %f", &stTest);
if (stTest < 0.0)
{
break;
}
total += stTest;
}
avg = total / numTest;
printf("/nThe average is %.1f%%./n", avg);
return 0;
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/266686.html