Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. void reverse(char *str, int count)
  7. {
  8. for( int x = 1; x <= count; x++)
  9. {
  10. cout << str[ count - x];//вывод пеевернутой строки
  11. }
  12. }
  13.  
  14.  
  15. int main() {
  16. // string S = "Test of pen";
  17.  
  18. char str[100] = "Test of pen";//строка которую мы будем переворачивать
  19. // str = strcpy(str, S);
  20. reverse(str, 6);// отправляем унк строку и до какого символа мы будем перевораивать строку
  21. // cout << str << endl;
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement