Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include<algorithm>
- using namespace std;
- int main()
- {
- string imie;
- cout<<"podaj imie"<<endl;
- cin>>imie;
- int dlugosc_imienia=imie.length();
- cout<<"dlugosc: "<<dlugosc_imienia<<endl;
- if(imie[dlugosc_imienia-1]=='a')
- cout<<"wydaje mi sie ze jestes kobieta"<<endl;
- else cout<<"wydaje mi sie ze jestes mezczyzna"<<endl;
- string wyraz;
- cout<<"podaj wyraz do odwrocenia bez spacji";
- cin>>wyraz;
- int dlg=wyraz.length();
- for(int i=dlg-1; i>=0; i--)
- {
- cout<<wyraz[i];
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement