C3总分平均分

求出某学生期末三门课程的总分及平均分,结果保留小数点后一位```

#include<stdio.h>
void main()
{
	double a, b, c, x, y;
	printf("输入三门课程分数");
	scanf("%lf,%lf,%lf", &a, &b, &c);
	x = a + b + c;
	y = x / 3;
	printf("sum=%.1lf,average=%.1lf\n", x, y);
}

猜你喜欢

转载自blog.csdn.net/Cinepic/article/details/83240599
C3