Advertisement
kxcoze

lab22_5_2

Sep 6th, 2020
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 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, l1, l2, l3;
  17.  
  18.     cout << "Введите значения радиуса трех окружностей: " << endl;
  19.     cin >> x >> y >> z;
  20.        
  21.     l1 = 2 * acos(-1.0) * x;
  22.     l2 = 2 * acos(-1.0) * y;
  23.     l3 = 2 * acos(-1.0) * z;
  24.  
  25.     cout << "Наибольшая длина равна: " << max(max(l1, l2), l3);
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement