daily pastebin goal
69%
SHARE
TWEET

Untitled

a guest Nov 9th, 2018 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "pch.h"
  2. #include <iostream>
  3. #include <cmath>
  4. using namespace std;
  5.  
  6. int max(int a, int b);
  7.  
  8. int main() {
  9.     setlocale(LC_ALL, "rus");
  10.     int a, b;
  11.     double c, d;
  12.     cout << "Введите числа a, b" << endl;
  13.     cin >> a >> b;
  14.     cout << max(a, b) << " больше чем " << a + b - max(a, b) << endl;
  15.     cout << "Значение выражения: " << max(a, 2 * b) * max(2 * a - b, b) << endl;
  16.     cout << "Введите 2 числа с плав. точкой" << endl;
  17.     cin >> c >> d;
  18.     cout << "Большее значение равно " << max(c, d);
  19.     return 0;
  20. }
  21.  
  22. int max(int a, int b) {
  23.     if (a > b) return a;
  24.     else return b;
  25. }
  26.  
  27. double max(double a, double b) {
  28.     if (a > b) return a;
  29.     else return b;
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top