Vla_DOS

Untitled

Jun 20th, 2022
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. double Max(double a, double b, double c) {
  6.     int max = 0;
  7.     if (a > b && a > c)
  8.         max = a;
  9.     else if (b > a && b > c)
  10.         max = b;
  11.     else if (c > a && c > b)
  12.         max = c;
  13.     return max;
  14. }
  15. int main() {
  16.     setlocale(LC_CTYPE, "");
  17.     double a, b, c;
  18.     cout << "Введiть 3 числа:" << endl;
  19.     cin >> a >> b >> c;
  20.     cout << "Найбiльше число = " << Max(a, b, c);
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment