问题:
Media = .85四舍五入 == .8
但是标准答案 == .9
——————————————————————————————————————————待解决————————————————————————————————————————————————————————————
/(ㄒoㄒ)//(ㄒoㄒ)//(ㄒoㄒ)/~~
#include <cstdio>
int main()
{
double a, b, c, d;
scanf("%lf%lf%lf%lf", &a, &b, &c, &d);
double m;
printf("Media: %.1lf\n", m = (a * 2 + b * 3 + c * 4 + d * 1) / 10);
if(m >= 7) printf("Aluno aprovado.\n");
else if(m < 5) printf("Aluno reprovado.\n");
else
{
if(m >= 5 && m <= 7) printf("Aluno em exame.\n");
double n, m2;
scanf("%lf", &n);
printf("Nota do exame: %.1lf\n", n);
m2 = (m + n) / 2;
if(m2 >= 5) printf("Aluno aprovado.\n");
else printf("Aluno reprovado.\n");
printf("Media final: %.1lf", m2);
}
return 0;
}