-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path661.cpp
More file actions
45 lines (41 loc) · 885 Bytes
/
661.cpp
File metadata and controls
45 lines (41 loc) · 885 Bytes
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
39
40
41
42
43
44
45
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
double n1;
double n2;
double n3;
double n4;
cin >> n1 >> n2 >> n3 >> n4;
double x = (n1 * 2 + n2 * 3 + n3 * 4 + n4 * 1) / 10;
printf("Media:%.1lf\n", x);
if (x >= 7.0)
{
cout << "Aluno aprovado." << endl;
}
else if (x < 5.0)
{
cout << "Aluno reprovado." << endl;
}
else
{
cout << "Aluno em exame." << endl;
double y;
cin >> y;
printf("Nota do exame:%.1lf\n", y);
double z;
z = (x + y) / 2;
if (z >= 5.0)
{
cout << "Aluno aprovado." << endl;
}
else
{
cout << "Aluno reprovado." << endl;
}
printf("Media final: %.1lf\n", z);
}
return 0;
}