BC33 计算平均成绩
#include<stdio.h>
/*
int main()
{
int score = 0;
int i = 0;
float sum = 0.0;
for(i = 0;i < 5 ;i++)
{
scanf("%d",&score);
sum+=score;
}
printf("%.1f",sum/5.0);
return 0;
}
*/
int main()
{
int score={0};
int i = 0;
float sum = 0.0;
for(i = 0;i < 5;i++)
{
scanf("%d",&score);
sum+=score;
}
printf("%.1f",sum/5.0);
return 0;
}
https://blog.51cto.com/u_15460718/4839520
页:
[1]