Advertisement
Guest User

Untitled

a guest
Aug 6th, 2016
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.12 KB | None | 0 0
  1. int sign(int a) { return (a < 0) ? -1 : 1; }
  2. int avg(int x, int y) { return (sign(x) == sign(y)) ? x+(y-x)/2 : (x+y)/2; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement