Guest User

Untitled

a guest
Sep 18th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdlib.h>
  3. #include <cstring>
  4. #include <stdio.h>
  5. #define MAXLEN 20
  6.  
  7. using namespace std;
  8.  
  9.  
  10. char S2[MAXLEN];
  11. char S1[MAXLEN];
  12. int counter=0;
  13. int var=0,var2=0;
  14. int i,j;
  15.  
  16.  
  17. int main()
  18. {
  19.    
  20.    
  21.        
  22.     gets(S1);
  23.  
  24.  
  25.        
  26.    
  27.    
  28.     for (i=0; S1[i]!='\0';i++){
  29.        
  30.        
  31.     }
  32.     var=i;
  33.     var2=i;
  34.         for (j=0,i=0; var>=0;j++,i++,var--){
  35.            
  36.            
  37.             S2[j]=S1[i];
  38.            
  39.            
  40.         }
  41.         S2[j] = '\0';
  42.    
  43.     j=0;
  44.     while (var2 >=0){
  45.         cout << S2[j];
  46.    
  47.         var2--;
  48.         j++;
  49.    
  50.     }
  51.    
  52.  
  53.    
  54.     return 0;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment