题目描述
按照示例保留一位浮点数
3个分支分别写出即可
样例
#include <iostream>
#include<cmath>
using namespace std;
int main()
{
double N1,N2,N3,N4,X,Y,Z;
scanf("%lf %lf %lf %lf\n",&N1,&N2,&N3,&N4);
X=0.2*N1+0.3*N2+0.4*N3+0.1*N4;
printf("Media: %.1lf\n",X);
if(X>=7.0)printf("Aluno aprovado.");
else if(X<5.0)printf("Aluno reprovado.");
else
{
printf("Aluno em exame.\n");
scanf("%lf",&Y) ;
printf("Nota do exame: %.1lf\n",Y);
Z=(X+Y)/2;
if(Z>=5.0)printf("Aluno aprovado.\n");
else printf("Aluno reprovado.\n");
printf("Media final: %.1lf\n",Z);
}
return 0;
}