#include
void main()
{
float a,b,c,d;
float sum=0,avg;
printf("请输入这几个数(逗号隔开):\n");
scanf("%f,%f,%f,%f",&a,&b,&c,&d);
sum=a+b+c+d;
avg=sum/4;
printf("这4个数的和sum=%.2f\n平均数avg=%.2f\n",sum,avg);
}
#include
void main()
{
float a,b,c,d;
float sum=0,avg;
printf("请输入这几个数(逗号隔开):\n");
scanf("%f,%f,%f,%f",&a,&b,&c,&d);
sum=a+b+c+d;
avg=sum/4;
printf("这4个数的和sum=%.2f\n平均数avg=%.2f\n",sum,avg);
}