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];
- }
- */ /*
- string napis3;
- cout<<endl<<"podaj wyraz ze spacjami"<<endl;
- cin.ignore();
- getline(cin,napis3);
- cout<<napis3<<endl; /
- int dlugosc2=napis3.length();
- cout<<dlugosc2<<endl; //dlugosc
- string jeden="Ala ma";
- string dwa=" kota"; //dodawanie dwoch slow
- string trzy=jeden+dwa;
- cout<<trzy<<endl;
- string jeden="Ala ma";
- string dwa=" kota"; //drugi wariant
- cout<<jeden+dwa<<endl; */
- string napis4="Ala ma kota";
- transform(napis4.begin()), napis4.end(), 'na' napis4.begin(), ;;towlower();
- transform(napis4.begin()), napis4.end(), 'na' napis4.begin(), ;;toupper();
- cout<<napis4;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement