Ziomnexpl

zad 1

Nov 4th, 2020
676
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4.  
  5. using namespace std;
  6.  
  7. int N(int a, int b, int c)
  8. {
  9.     if(a <= b)
  10.     {
  11.         if (a <= c)
  12.         {
  13.             return a;
  14.         }
  15.         else
  16.         {
  17.             return c;
  18.         }
  19.     }
  20.     return b;
  21. }
  22.  
  23.  
  24. int main(int argc, char** argv) {
  25.     int a, b, c;
  26.     ifstream odczyt("ryt.txt");
  27.     odczyt >> a >> b >> c;
  28.     cout << a << " " << b << " " << c<<endl;
  29.     cout<< "najmniejsza liczba to " << N(a, b, c);
  30.     odczyt.close();
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment