-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1040.c
More file actions
28 lines (28 loc) · 658 Bytes
/
1040.c
File metadata and controls
28 lines (28 loc) · 658 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
#include <stdio.h>
int main()
{
double a, b, c, d, l, m;
scanf("%lf %lf %lf %lf", &a, &b, &c, &d);
m = (a * 2 + b * 3 + c * 4 + d) / 10;
printf("Media: %.1f\n", m);
if (m >= 7.0){
printf("Aluno aprovado.\n");
}
else if (m >= 5.0)
{
printf("Aluno em exame.\n");
scanf("%lf", &l);
printf("Nota do exame: %.1f\n", l);
if (l + m / 2.0 > 5.0){
printf("Aluno aprovado.\n");
}
else{
printf("Aluno reprovado.\n");
}
printf("Media final: %.1f\n", (l + m ) / 2.0);
}
else{
printf("Aluno reprovado.\n");
}
return 0;
}