Advertisement
UMIT_GATH

ادخال سلسلة وقلبها

Feb 6th, 2023 (edited)
1,147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | Source Code | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5.  
  6.  
  7.  
  8. int main()
  9. {
  10.  
  11. char* text = new char[51];
  12. int counter;
  13.  
  14. cin.getline(text,51,'*');
  15.  
  16. for(int i=0 ; text[i]!='\0' ; i++)
  17. counter = i;
  18.  
  19. for(int i=counter ; i>=0 ; i--)
  20. cout<<text[i];
  21.  
  22. cout<<endl;
  23.  
  24. delete[] text;
  25.  
  26.     return 0;
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement