Advertisement
encoree1996

Untitled

Jul 4th, 2014
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <cstdio>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {        
  9.       int x; // wiek
  10.       bool niepelnoletni; // to nie kurwa obiekt
  11.      
  12.       cout << "Podanie liczby mniejszej niz 0 lub wiekszej niz 116\nskutkuje zamnkieciem programu\nPodaj swoj wiek : ";
  13.       cin >> x; // przyjecie danych z klawiatury
  14.       niepelnoletni = (x < 18 && x>=0);
  15.      
  16.      
  17.       if(x<0){
  18.       cout<<"Liczba "<<x<<" jest za mala!\n";
  19.       return 0;
  20.       }
  21.       if(x>116){
  22.       cout << "Liczba "<< x << " jest za duza - nastepuje wyjscie z programu\n";
  23.       return 0;
  24.       }    
  25.    
  26.     cout<<"Masz "<<x<<" lat - jestes "<<(niepelnoletni?"niepelnoletni!\n":"pelnoletni!\n");
  27.      
  28.       return 0;
  29.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement