-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbeecrowd 1118.cpp
More file actions
85 lines (57 loc) · 1.43 KB
/
beecrowd 1118.cpp
File metadata and controls
85 lines (57 loc) · 1.43 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include<iostream>
#include<iomanip>
using namespace std;
int main(){
double x,y,a,b,sum1=0,sum2=0,sum=0,avg=0;
while (1)
{
func:{
cin>>x;
if(x>=0 and x<=10){
sum1=sum1+x;
}
else{
cout<<"nota invalida"<<endl;
}
if(sum1==0){
goto func;
}
}
func1:{
cin>>y;
if(y>=0 and y<=10){
sum2=sum2+y;
}
else{
cout<<"nota invalida"<<endl;
}
if(sum2==0){
goto func1;
}
}
sum=sum1+sum2;
avg=sum/2;
cout<<fixed<<setprecision(2);
cout<<"media = "<<avg<<endl;
cout<<"novo calculo (1-sim 2-nao)"<<endl;
sum=0;
sum1=0;
avg=0;
sum2=0;
func3:{
cin>>a;
if(a==1){
goto func;
goto func1;
}
if(a==2){
break;
}
else{
cout<<"novo calculo (1-sim 2-nao)"<<endl;
goto func3;
}
}
}
return 0;
}