Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include<algorithm>
  4.  
  5. using namespace std;
  6.  
  7.  
  8. int main()
  9. {
  10. string imie;
  11. cout<<"podaj imie"<<endl;
  12. cin>>imie;
  13. int dlugosc_imienia=imie.length();
  14. cout<<"dlugosc: "<<dlugosc_imienia<<endl;
  15. if(imie[dlugosc_imienia-1]=='a')
  16. cout<<"wydaje mi sie ze jestes kobieta"<<endl;
  17. else cout<<"wydaje mi sie ze jestes mezczyzna"<<endl;
  18.  
  19. string wyraz;
  20. cout<<"podaj wyraz do odwrocenia bez spacji";
  21. cin>>wyraz;
  22.  
  23. int dlg=wyraz.length();
  24. for(int i=dlg-1; i>=0; i--)
  25. {
  26. cout<<wyraz[i];
  27. }
  28.  
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement