题目描述
平均数3
样例
#include <iostream>
using namespace std;
int main()
{
double a,b,c,d,x,y,z;
scanf("%lf%lf%lf%lf",&a,&b,&c,&d);
x=(2*a+3*b+c*4+d)/10.0;
printf("Media: %.1lf\n",x);
if(x>=7.0)
printf("Aluno aprovado.\n");
else if(x<5.0)
printf("Aluno reprovado.\n");
if(x>=5.0&&x<7.0)
{
printf("Aluno em exame.\n");
scanf("%lf",&y);
printf("Nota do exame: %.1lf\n",y);
z=(x+y)/2.0;
if(z>=5.0)
printf("Aluno aprovado.\n");
else
printf("Aluno reprovado.\n");
printf("Media final: %.1lf",z);
}
return 0;
}