Advertisement
nikolay7minecraft

homework 3-3

Sep 23rd, 2019
637
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. // homework 3
  2. // ex 3
  3. #include <iostream>
  4. #include <cmath>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.   double a;
  11.   double b;
  12.   double c;
  13.   double f;
  14.  
  15.   cout << "first number ";
  16.   cin >> a;
  17.  
  18.   cout << "second number ";
  19.   cin >> b;
  20.  
  21.   cout << "another number ";
  22.   cin >> c;
  23.  
  24.   cout << "and another number ";
  25.   cin >> f;
  26.    
  27.   if ((a==c)&&(a==b)&&(a==f))
  28.   {
  29.       cout << "minimum number " << a << endl;
  30.   }
  31.  
  32.   if ((a<b)&&(a<c)&&(a<f))
  33.   {
  34.       cout << "minimum number " << a << endl;
  35.   }
  36.  
  37.   if ((b<a)&&(b<c)&&(b<f))
  38.   {
  39.       cout << "minimum number " << b << endl;
  40.   }
  41.      
  42.   if ((c<a)&&(c<b)&&(c<f))
  43.   {
  44.       cout << "minimum number " << c << endl;
  45.   }
  46.  
  47.   if ((f<a)&&(f<b)&&(f<c))
  48.   {
  49.       cout << "minimum number " << f << endl;
  50.   }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement