The_Law

Untitled

Jan 12th, 2018
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int x = 5, y = 2;
  5. int a[5] = {1, 2, 3};
  6.  
  7. int f(int *p, int *q)
  8. {
  9.     static int a = 3;
  10.     if (--a)
  11.         return *p++ += *q--;
  12.     return *q++ -= *p--;
  13. }
  14.  
  15. int main(void)
  16. {
  17.     int x = 2 * a[--y], b = 0;
  18.  
  19.     for (int y = x; y >= b; --y, ++x)
  20.         b = f(a + b, a + y);
  21.  
  22.     printf("%d %d %d %d %d\n", a[0], a[1], a[2], a[3], a[4]);
  23.     printf("%d %d", x, y);
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment