-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1118.cpp
More file actions
38 lines (34 loc) · 881 Bytes
/
1118.cpp
File metadata and controls
38 lines (34 loc) · 881 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
#include <iostream>
#include <stdio.h>
int main()
{
float t,n,a[2];
while(1)
{
int i=0;
while(1)
{
scanf("%f",&n);
if(n>=0&&n<=10)
{
a[i]=n;i++;
if(i==2)
{
printf("media = %.2f\n",(a[0]+a[1])/2);
break;
}
}
else printf("nota invalida\n");
}
int z;
while(1)
{
scanf("%d",&z);
printf("novo calculo (1-sim 2-nao)\n");
if(z==1||z==2) break;
}
if(z==1) continue;
else if(z==2) break;
}
return 0;
}