Advertisement
dllbridge

Untitled

Sep 29th, 2022
1,313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.85 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. using namespace std;
  4.  
  5.  
  6. //////////////////////////////////////////////////////////////
  7. int main()
  8. {
  9.  
  10.     int a, b, c, nMin;
  11.    
  12.     cin >> a >> b >> c;
  13.    
  14.    
  15.     if(a <    b) nMin = a;
  16.     else         nMin = b;
  17.    
  18.     if(c < nMin) nMin = c;
  19.  
  20.     cout <<nMin;
  21.        
  22.    
  23. return 0;
  24. }
  25.  
  26.  
  27.  
  28. /*
  29. // Это оформление лучше
  30.  
  31. #include <iostream>
  32. using namespace std;
  33.  
  34.  
  35. //////////////////////////////////////////////////////////////
  36. int main()
  37. {
  38.  
  39.     int a, b, c;
  40.    
  41.     cin >> a >> b >> c;
  42.    
  43.     if((a < b) && (a < c)) { cout << a; }
  44.     else
  45.     {
  46.        if((b < a) && (b < c))
  47.        {
  48.           cout << b;
  49.        }
  50.        else
  51.        {
  52.           if((c < a) && (c < b))
  53.           {
  54.              cout << c;
  55.           }
  56.        }
  57.     }
  58.    
  59. return 0;
  60. }
  61.  
  62.  
  63.  
  64.  
  65. */
  66.  
  67.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement