#include <stdio.h>
int main()
{
int buf[4];
int i ;
int sum = 0;
float aver =0;
printf("please input four scores:\n");
for (i = 0; i < 4; i++)
{
scanf("%d", &buf[i]);
}
sum = buf[0]+buf[1]+buf[2]+buf[3];
aver = sum/4.0;
printf("total : %d; average : %d\n"; sum, aver)
return 0;
}
温馨提示:答案为网友推荐,仅供参考