SHOW:
|
|
- or go back to the newest paste.
1 | #include <iostream> | |
2 | using namespace std; | |
3 | ||
4 | int main(); | |
5 | int age[] = {17,24}; | |
6 | string name[] = {"roma","dima"}; | |
7 | ||
8 | //*************************************************************************************** | |
9 | - | void main2() |
9 | + | |
10 | void baza() | |
11 | - | cout << endl << "punct list" << endl |
11 | + | |
12 | - | << "1 - baza dannix" << endl |
12 | + | do |
13 | - | << "2 - dopolnitelnie funkchii" << endl << endl |
13 | + | |
14 | - | << "vvedite punct: "; |
14 | + | |
15 | cout << "vvedite id: "; | |
16 | - | int punct; |
16 | + | |
17 | - | cin >> punct; |
17 | + | |
18 | ||
19 | - | cout << endl; |
19 | + | |
20 | { | |
21 | - | if(punct < 1 || punct > 2) |
21 | + | |
22 | } | |
23 | - | cout << "error" << endl; |
23 | + | |
24 | if(id < 1 || id > 2) | |
25 | - | if(punct == 2) |
25 | + | |
26 | cout << "error" << endl; | |
27 | - | function(); |
27 | + | |
28 | - | } |
28 | + | |
29 | - | if(punct == 1) |
29 | + | |
30 | cout << endl << "hotite prodolzit?: "; | |
31 | - | baza(); |
31 | + | string vopros; |
32 | cin >> vopros; | |
33 | ||
34 | if(vopros == "net") | |
35 | { | |
36 | cout << endl; | |
37 | main(); | |
38 | } | |
39 | if(vopros != "da") | |
40 | { | |
41 | cout << endl << "error(!=(da,net))" << endl; | |
42 | } | |
43 | if(vopros == "da") | |
44 | { | |
45 | cout << endl; | |
46 | baza(); | |
47 | } | |
48 | } | |
49 | while(true); | |
50 | } | |
51 | while(true); | |
52 | } | |
53 | ||
54 | //******************************************************************************** | |
55 | - | cout << endl << "hotite prodolzit?: "; |
55 | + | |
56 | - | string vopros; |
56 | + | |
57 | - | cin >> vopros; |
57 | + | |
58 | cout << "dopolnitelnie funkchii" << endl | |
59 | << "1 - naiti samogo starshego" << endl | |
60 | << "2 - naiti srednij vozrast" << endl | |
61 | << "3 - redaktor" << endl << endl | |
62 | << "vvedite punct: "; | |
63 | - | main2(); |
63 | + | |
64 | int punct; | |
65 | cin >> punct; | |
66 | ||
67 | - | cout << "error(baza)" << endl; |
67 | + | if(punct < 1 || punct > 3) |
68 | { | |
69 | cout << "error" << endl; | |
70 | } | |
71 | ||
72 | if(punct == 1) | |
73 | { | |
74 | int a = 0; | |
75 | int b = 0; | |
76 | for(int i = 0 ; i < 2 ; i++) | |
77 | { | |
78 | if(a < age[i]) | |
79 | { | |
80 | a = age[i]; | |
81 | b = i; | |
82 | } | |
83 | - | cout << "list" << endl |
83 | + | |
84 | - | << "dopolnitelnie funkchii" << endl |
84 | + | cout << endl << "age: " << age[b] << endl << "name: " << name[b] << endl << endl; |
85 | main(); | |
86 | - | << "2 - naiti srednij vozrast" << endl << endl |
86 | + | |
87 | if(punct == 2) | |
88 | { | |
89 | int resultat = 0; | |
90 | for(int i = 0 ; i < 2 ; i++) | |
91 | { | |
92 | - | if(punct < 1 || punct > 2) |
92 | + | |
93 | } | |
94 | resultat /= 2; | |
95 | cout << endl << "srednij vozrast: "<< resultat << endl << endl; | |
96 | main(); | |
97 | } | |
98 | } | |
99 | ||
100 | //******************************************************************************** | |
101 | ||
102 | int main() | |
103 | { | |
104 | { | |
105 | cout << "punct list" << endl | |
106 | << "1 - baza dannix" << endl | |
107 | << "2 - dopolnitelnie funkchii" << endl | |
108 | << "3 - exit" << endl << endl | |
109 | - | cout << endl << "age: " << age[b] << endl << "name: " << name[b] << endl; |
109 | + | << "vvedite punct: "; |
110 | ||
111 | int punct; | |
112 | cin >> punct; | |
113 | ||
114 | cout << endl; | |
115 | ||
116 | if(punct < 1 || punct > 3) | |
117 | { | |
118 | cout << "error" << endl; | |
119 | - | cout << "srednij vozrast: "<< resultat << endl; |
119 | + | |
120 | if(punct == 2) | |
121 | { | |
122 | function(); | |
123 | } | |
124 | if(punct == 1) | |
125 | { | |
126 | baza(); | |
127 | - | main2(); |
127 | + | |
128 | if(punct == 3) | |
129 | { | |
130 | return false; | |
131 | } | |
132 | } | |
133 | } |