Advertisement
imk0tter

Untitled

May 5th, 2014
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. //*(&x + 8) = the value of x from the previous iteration
  2. void f(int x)
  3. {
  4.     if (x > 0)
  5.     {  
  6.         x = -x;
  7.         printf("1\n");
  8.         f(-2);
  9.     }
  10.     else
  11.     {
  12.         if (*(&x + 8) <= x)
  13.         {
  14.             printf("%i\n", -x);
  15.             if (*(&x + 8) != x)
  16.                 f(*(&x + 8));
  17.         }
  18.         else
  19.         {
  20.             printf("%i\n", -(*(&x + 8) - 1));
  21.             if (x != *(&x + 8) - 1)
  22.                 f(*(&x + 8) - 2);
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement