AcWing 661. 平均数3
原题链接
中等
作者:
Owen_1
,
2020-07-21 15:15:05
,
所有人可见
,
阅读 597
#include <cstdio>
int main()
{
float a, b, c, d, X;
scanf("%f %f %f %f", &a, &b, &c, &d);
printf("Media: %.1f\n", (2 * a + 3 * b + 4 * c + d) / 10);
X = (2 * a + 3 * b + 4 * c + d) / 10;
if (X >= 7.0) printf("Aluno aprovado.\n");
else if(X < 5.0) printf("Aluno reprovado.\n");
else if(X >= 5.0 && X < 7.0)
{
printf("Aluno em exame.\n");
float Y;
scanf("%f", &Y);
printf("Nota do exame: %.1f\n", Y);
float Z = (Y + X) / 2;
if (Z > 5.0) printf("Aluno aprovado.\n");
else printf("Aluno reprovado.\n");
printf("Media final: %.1f\n", Z);
}
return 0;
}