ramytamer

queen

Apr 16th, 2014
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. int main(){
  2.     int x1, x2, y1, y2;
  3.      while(scanf("%d %d %d %d", &x1, &x1, &y1, &y2)>0){
  4.         if(x1 == 0 && x2 == 0 && y1 == 0 && y2 == 0) return 0;
  5.         if(x1 == x2 && y1 == y2) printf("0\n");
  6.         else if(x1 == x2 || y1 == y2) printf("1\n");
  7.         else if(abs(x1 - x2) == abs(y1 - y1)) printf("1\n");
  8.         else printf("2\n");
  9.     }
  10.     return 0;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment