Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1.
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int age;
- int aver, a,b;
- int avr(int age)
- {
- a = age / 10;
- b = age % 10;
- aver = (a + b) / 2;
- return aver;
- }
- int main()
- {
- setlocale(LC_ALL, "Russian");
- cout << "Введите возраст: ";
- cin >> age;
- aver = avr(age);
- cout << endl << "Сред. Арифм:" << aver << endl;
- system("pause");
- return 0;
- }
- 2.
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int a,b;
- int max(int a, int b)
- {
- if (a > b)
- return a;
- else
- return b;
- }
- int main()
- {
- setlocale(LC_ALL, "Russian");
- cout << "Введите 2 числа: ";
- cin >> a >> b;
- cout << endl << max(a,b) << endl;
- system("pause");
- return 0;
- }
- 3.
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int input,a,b;
- int obr(int input)
- {
- a = input / 10;
- b = input % 10;
- return b * 10 + a;
- }
- int main()
- {
- setlocale(LC_ALL, "Russian");
- cout << "Введите число: ";
- cin >> input;
- cout << endl << obr(input) << endl;
- system("pause");
- return 0;
- }
- 4.
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int a, b;
- int i = 0;
- string input;
- const char* glas = "AaEeIiOoUuYy";
- string obr(string input)
- {
- for (int i = 0; i < 12; i++)
- if (input[0] == glas[i])
- {
- return "гласная";
- }
- else
- return "не гласная";
- }
- int main()
- {
- setlocale(LC_ALL, "Russian");
- cin >> input;
- cout << endl << obr(input) << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement