-
Notifications
You must be signed in to change notification settings - Fork 0
/
1040.cpp
39 lines (31 loc) · 822 Bytes
/
1040.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include<bits/stdc++.h>
using namespace std ;
int main(){
ios_base::sync_with_stdio(false) ;
cin.tie(NULL);
float a,b,c,d,e;
double avg,avrg ;
cin>>a>>b>>c>>d ;
avg = (a*2+b*3+c*4+d*1)/(10.0) ;
cout<<"Media: "<<fixed<<setprecision(1)<<avg<<endl ;
if(avg>=7.0){
cout<<"Aluno aprovado."<<endl ;
}
else if(avg<5.0){
cout<<"Aluno reprovado."<<endl ;
}
else if(avg>=5.0&&avg<=6.9){
cout<<"Aluno em exame."<<endl ;
cin>>e ;
cout<<"Nota do exame: "<<fixed<<setprecision(1)<<e<<endl ;
avrg=(avg+e)/2 ;
if(avrg>=5.0){
cout<<"Aluno aprovado."<<endl ;
}
else if(avrg<=4.9){
cout<<"Aluno reprovado."<<endl ;
}
cout<<"Media final: "<<fixed<<setprecision(1)<<avrg<<endl ;
}
return 0 ;
}