Advertisement
kxcoze

lab22_5_1

Sep 6th, 2020
466
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3.  
  4. using namespace std;
  5.  
  6. double max(double a, double b) {
  7.     if (a > b)
  8.         return a;
  9.     else
  10.         return b;
  11. }
  12.  
  13. int main() {
  14.     setlocale(LC_ALL, "rus");
  15.        
  16.     double x, y, z;
  17.  
  18.     cout << "Введите x: ";
  19.     cin >> x;
  20.  
  21.     cout << "Введите y: ";
  22.     cin >> y;
  23.    
  24.     z = max(x, y);
  25.     cout << "z = " << z;
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement