-
Notifications
You must be signed in to change notification settings - Fork 1
/
1040.c
42 lines (32 loc) · 767 Bytes
/
1040.c
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
#include<stdio.h>
int main(){
float N1, N2, N3, N4, avg1, s1, avg2;
scanf("%f %f %f %f", &N1, &N2, &N3, &N4);
avg1 = (N1*2 + N2*3 + N3*4 + N4*1)/(2+3+4+1);
printf("Media: %.1f\n", avg1);
if(avg1>7.0)
{
printf("Aluno aprovado.\n");
}
else if(avg1<5.0)
{
printf("Aluno reprovado.\n");
}
else if(avg1>=5.0 && avg1<=6.9)
{
printf("Aluno em exame.\n");
scanf("%f", &s1);
printf("Nota do exame: %.1f\n", s1);
avg2 = (avg1 + s1)/2;
if(avg2>5.0)
{
printf("Aluno aprovado.\n");
}
else if(avg2<4.9)
{
printf("Aluno reprovado.\n");
}
printf("Media final: %.1f\n", avg2);
}
return 0;
}