Advertisement
_TEXNIK_

Untitled

Aug 16th, 2024
34
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 <cstring>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. setlocale(LC_ALL, "ru");
  8.  
  9. const int MAX = 80;
  10. char str[MAX];
  11. int len = 0;
  12.  
  13. cout << "\n Введите строку: ";
  14.  
  15. cin >> str;
  16. len = strlen(str);
  17.  
  18. for ( int i = 0; i < len / 2; i++ )
  19. {
  20. char temp = str[i];
  21. str[i] = ( len - i - 1);
  22. str[len - i - 1] = temp;
  23. }
  24.  
  25. cout << str;
  26.  
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement