Advertisement
thedavjoe

Untitled

Nov 12th, 2018
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <string>
  4. #include <cmath>
  5. #include <iomanip>
  6. #include <conio.h>
  7.  
  8. using namespace std;
  9.  
  10. int main()
  11.  
  12. {
  13.     float liczba,max=0,min=0;
  14.     char pytanie;
  15.    
  16.     do
  17.     {
  18.         cout<<"Podaj liczbe ciagu : ";
  19.         cin>>liczba;
  20.         if (liczba>max)
  21.         {
  22.             max=liczba;
  23.         }
  24.         else if (liczba<min)
  25.         {
  26.             min=liczba;
  27.         }
  28.         cout<<"Chcesz wprowadzic kolejna liczbe? t-tak : ";
  29.         cin>>pytanie;
  30.     }
  31.     while (pytanie=='t');
  32.     cout<<"MAX = "<<max<<"   MIN = "<<min<<endl;
  33.    
  34.    
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement