#include<stdio.h>
int main()
{
int a,b,c,d,Sum;
double Average;
scanf("%d %d %d %d",&a,&b,&c,&d);
Sum=a+b+c+d;
Average=Sum/4.0;
printf(“Sum = %d; Average = %.1f”,Sum,Average);
return 0;
}
习题2-1 求整数均值
最新推荐文章于 2021-10-05 08:46:28 发布
#include<stdio.h>
int main()
{
int a,b,c,d,Sum;
double Average;
scanf("%d %d %d %d",&a,&b,&c,&d);
Sum=a+b+c+d;
Average=Sum/4.0;
printf(“Sum = %d; Average = %.1f”,Sum,Average);
return 0;
}