题目描述
平均数3
情况3有一点复杂
样例
#include<stdio.h>
int main()
{
double a, b, c, d,x;
scanf("%lf%lf%lf%lf", &a, &b, &c, &d);
x = ( a * 2 + b * 3 + c * 4 + d ) / 10;
printf("Media: %.1lf\n", x);
if (x >= 7)
{
printf("Aluno aprovado.\n");
return 0;
}
if (x < 5)
{
printf("Aluno reprovado.\n");
return 0;
}
double y;
printf("Aluno em exame.\n");
scanf("%lf", &y);
printf("Nota do exame: %.1lf\n", y);
double z = (x + y) / 2.0;
if (z >= 5.0)
printf("Aluno aprovado.\n");
else printf("Aluno reprovado.\n");
printf("Media final: %.1lf\n", z);
return 0;
}