AcWing 661. 平均数3
原题链接
简单
作者:
fengyutong
,
2024-11-11 21:11:59
,
所有人可见
,
阅读 1
之前只从开头读入,没想到还能在中间读入
\n老是忘记加
#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
double n1,n2,n3,n4;
cin>>n1>>n2>>n3>>n4;
double x=(n1*2+n2*3+n3*4+n4)/10;
printf("Media: %.1lf\n",x);
if(x>=7) cout<<"Aluno aprovado."<<endl;
else if(x<5) cout<<"Aluno reprovado."<<endl;
else
{
cout<<"Aluno em exame."<<endl;
double y,z;
cin>>y;
printf("Nota do exame: %.1lf\n",y);
z=(x+y)/2;
if(z>=5) cout<<"Aluno aprovado."<<endl;
else cout<<"Aluno reprovado."<<endl;
printf("Media final: %.1lf\n",z);
}
return 0;
}