SHARE
TWEET

Untitled

a guest Dec 17th, 2018 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. string reverse (string temp , int length )
  2. {
  3.     if(length==1)
  4.     { return temp; }
  5.         else
  6.     {
  7.  
  8.  
  9.     int t = (temp.length ()+1) / 2;
  10.     return  (reverse( temp.substr(t, temp.length() -1 ), t) + reverse (  temp.substr(0 ,t ) ,t  )  );  
  11.  
  12.  
  13.  
  14.        }
  15.  
  16. }
  17.  
  18. int main( ) {
  19.     string s;
  20.     cin>>s;  
  21.     string rev = reverse (s , s.length() );
  22.     cout <<"n"<<rev;
  23.     cin>>s;
  24.  
  25.     return 0;
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top