Guest User

Untitled

a guest
Jun 20th, 2012
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.77 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main ()
  4. {
  5.   char chn[81], crt, *ptr1, *ptr2;
  6.   scanf ("%80[^\n]",chn);
  7.  
  8.   ptr1 = ptr2 = chn;
  9.   while (*++ptr2);
  10.   ptr2--;
  11.   while (ptr1 < ptr2) {
  12.     *ptr1 ^= *ptr2;
  13.     *ptr2 ^= *ptr1;
  14.     *ptr1 ^= *ptr2;
  15.     ptr1++; ptr2--;
  16.   }
  17.  
  18.   ptr2 = chn;
  19.   while (*ptr2 != ' ' && *ptr2) ptr2++;
  20.   ptr1 = chn - 1;
  21.  
  22.   while (1)
  23.     {
  24.       ptr1++;
  25.       ptr2--;
  26.  
  27.       while (ptr1 < ptr2) {
  28.         *ptr1 ^= *ptr2;
  29.         *ptr2 ^= *ptr1;
  30.         *ptr1 ^= *ptr2;
  31.         ptr1++; ptr2--;
  32.       }
  33.  
  34.       ptr2++;
  35.       while (*ptr2 != ' ' && *ptr2) ptr2++;
  36.       if (!*ptr2) break;
  37.       ptr1 = ptr2;
  38.       ptr2++;
  39.       while (*ptr2 != ' ' && *ptr2) ptr2++;
  40.     }
  41.  
  42.   /* Insérez votre code ici */
  43.   printf ("%s\n",chn);
  44.   return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment