pan7nikt

Wyraz_Odwrocony_doString

Mar 4th, 2020
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. //Podajemy wyraz. Program wypisuje go od tylu
  2. #include <iostream>
  3. #include <string>
  4. using namespace std;
  5.  
  6. int i;
  7. string wyraz;
  8. string output;
  9.  
  10. int main()
  11. {
  12.     cout << "Podaj wyraz: ";
  13.     cin >> wyraz;
  14.     for(i=wyraz.length();i>=0;i--)
  15.     {
  16.         //cout << wyraz[i];
  17.         output = output + wyraz[i];
  18.     }
  19.    
  20.     cout << "Ten wyraz po odwroceniu to: " << output << endl;
  21. }
Add Comment
Please, Sign In to add comment