Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. string str, eingabestr, ausgabestr = "";
  8. int j = 0;
  9. cout << "Text: ? ";
  10. getline(cin, eingabestr);
  11.  
  12. j = eingabestr.length();
  13.  
  14. for (int i = 0; i < eingabestr.length(); i++) {
  15.  
  16. if (eingabestr[i] == 'a') {
  17. ausgabestr[j] = str[0];
  18. }
  19. else {
  20. ausgabestr[j] = eingabestr[i];
  21. }
  22. cout << ausgabestr[j];
  23. j--;
  24. }
  25.  
  26.  
  27.  
  28.  
  29. system("PAUSE");
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement