forked from Nastasia8/informatics_42_2021
-
Notifications
You must be signed in to change notification settings - Fork 0
/
4_Лаба_1.cpp
119 lines (113 loc) · 2.66 KB
/
4_Лаба_1.cpp
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int a,b,c,d,e,f;
double x,y;
chislo:
cout <<"Vvedite chisla x,y"<<endl;
cout <<"x: ";
if (cin >> x)
{
cout <<"y: ";
if(cin >> y)
{
goto q1;
}
else
{
goto eror;
}
}
else
{
goto eror;
}
q1:
cout <<"Vyberete nomer operaczii" <<endl<<endl;
cout <<"1 Summa"<<endl;
cout <<"2 Proizvedenie"<<endl;
cout <<"3 Delenie"<<endl;
cout <<"4 Vychitanie"<<endl;
cout <<"5 Vozvedenie chisla x v stepen y"<<endl;
cout <<"6 Vvesti novye chisla"<<endl;
cout <<"7 Vyiti"<<endl<<endl<<endl;
if (cin >> a)
{
if (a==1)
{
cout <<endl<<endl<<endl<<endl<<endl<<endl<<endl<<" Summa"<<endl<<endl;
double sum;
sum=x+y;
cout <<"Summa= "<<sum<<endl;
vozvr:
cout <<"Dlya vozvrasheniya nazhmite 1, dlya zaversheniya programmy nazhmite lyubuyu czyfru"<<endl;
if (cin >> f)
{
if (f==1)
{
goto q1;
}
else
{
goto kon;
}
}
else
{
goto eror;
}
}
if (a==2)
{
cout <<endl<<endl<<endl<<endl<<endl<<endl<<endl<<" Proizvedenie"<<endl<<endl;
double proiz;
proiz=x*y;
cout <<"Proizvedenie= "<<proiz<<endl;
goto vozvr;
}
if (a==3)
{
cout <<endl<<endl<<endl<<endl<<endl<<endl<<endl<<" Delenie"<<endl<<endl;
double delen;
delen=x/y;
cout <<"Delenie= "<<delen<<endl;
goto vozvr;
}
if (a==4)
{
cout <<endl<<endl<<endl<<endl<<endl<<endl<<endl<<" Vychitanie"<<endl<<endl;
double vychit;
vychit=x-y;
cout <<"Vychitanie= "<<vychit<<endl;
goto vozvr;
}
if (a==5)
{
cout <<endl<<endl<<endl<<endl<<endl<<endl<<endl<<" Vozvedenie chisla x v stepen y"<<endl<<endl;
double vozved;
vozved=pow(x,y);
cout <<"Vozvedenie chisla x v stepen y= "<<vozved<<endl;
goto vozvr;
}
if (a==6)
{
cout <<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
goto chislo;
}
if (a==7)
{
goto kon;
}
}
else
{
goto eror;
}
eror:
cout << "Введённые символы некоректны";
return 0;
kon:
return 0;
}