Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 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. string napis3;
  30. cout<<endl<<"podaj wyraz ze spacjami"<<endl;
  31. cin.ignore();
  32. getline(cin,napis3);
  33. cout<<napis3<<endl; /
  34.  
  35. int dlugosc2=napis3.length();
  36. cout<<dlugosc2<<endl; //dlugosc
  37.  
  38. string jeden="Ala ma";
  39. string dwa=" kota"; //dodawanie dwoch slow
  40. string trzy=jeden+dwa;
  41. cout<<trzy<<endl;
  42.  
  43. string jeden="Ala ma";
  44. string dwa=" kota"; //drugi wariant
  45. cout<<jeden+dwa<<endl; */
  46.  
  47. string napis4="Ala ma kota";
  48. transform(napis4.begin()), napis4.end(), 'na' napis4.begin(), ;;towlower();
  49.  
  50. transform(napis4.begin()), napis4.end(), 'na' napis4.begin(), ;;toupper();
  51. cout<<napis4;
  52.  
  53.  
  54. return 0;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement