Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- #include <cmath>
- using namespace std;
- int max(int a, int b);
- int main() {
- setlocale(LC_ALL, "rus");
- int a, b;
- double c, d;
- cout << "Введите числа a, b" << endl;
- cin >> a >> b;
- cout << max(a, b) << " больше чем " << a + b - max(a, b) << endl;
- cout << "Значение выражения: " << max(a, 2 * b) * max(2 * a - b, b) << endl;
- cout << "Введите 2 числа с плав. точкой" << endl;
- cin >> c >> d;
- cout << "Большее значение равно " << max(c, d);
- return 0;
- }
- int max(int a, int b) {
- if (a > b) return a;
- else return b;
- }
- double max(double a, double b) {
- if (a > b) return a;
- else return b;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement