Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- typedef sword word;
- typedef word* sword;
- sword outword(int in_number, sword in_Im_ed, sword in_Rod_ed, sword in_Rod_mn)
- {
- int if100 = in_number % 100;
- int snumber = in_number % 10;
- switch (snumber)
- {
- case 0:
- return in_Rod_mn;
- case 1:
- {
- if (if100 == 11)
- return in_Rod_mn;
- return in_Im_ed;
- }
- case 2:
- case 3:
- case 4:
- {
- if ((if100 >= 12) && (if100 <= 14))
- return in_Rod_mn;
- return in_Rod_ed;
- }
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- return in_Rod_mn;
- }
- }
- int main()
- {
- setlocale(0, "");
- srand(time(NULL));
- sword wordUgl[] = {"больше", "меньше"};
- sword wordSearh[] = {"больший", "меньший"};
- int selectRand1 = rand() % 2;
- int selectRand2 = rand() % 2;
- int ugol = rand() % 180 + 1;
- int raznost = 180 - ugol;
- cout << "Задание:" << endl;
- cout << "Один угол параллелограмма " << wordUgl[selectRand1] << " другого на "<< raznost <<" " << outword(raznost, "градус", "градуса", "градусов");
- cout << " Найдите " << wordSearh[selectRand2] << " угол. Ответ дайте в градусах" << endl;
- cout << "Ответ:" << endl;
- if ((selectRand2 == 0 && ugol >= 89) || (selectRand2 == 1 && ugol <= 89))
- cout << ugol << endl;
- if ((selectRand2 == 1 && ugol >= 89) || (selectRand2 == 0 && ugol <= 89))
- cout << raznost << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement