Advertisement
rootuss

stringi1

Feb 27th, 2017
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     string imie;
  8.     cout<<"Podaj imie: ";
  9.     cin>>imie;
  10.  
  11.     int dlugosc = imie.length();
  12.     //cout<<dlugosc<<endl;
  13.     cout<<endl;
  14.     if(imie[dlugosc-1]=='a')
  15.     {
  16.         cout<<"Jest to kobieta"<<endl;
  17.     }
  18.     else
  19.     {
  20.         cout<<"Jest to mezczyzna"<<endl;
  21.     }
  22.  
  23.  
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement