-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1087.c
42 lines (40 loc) · 837 Bytes
/
1087.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include<stdio.h>
int main()
{
int a,a1,b,b1;
while(scanf("%d %d %d %d",&a,&a1,&b,&b1)!=EOF)
{
if(a==0 && a1==0 && b==0 && b1==0)
{
break;
}
else
{
if(a==b && a1==b1 )
{
printf("0\n");
}
else if(a==b || a1==b1)
{
printf("1\n");
}
else if(a==a1 && b==b1)
{
printf("1\n");
}
else if((a-b)+(a1-b1)==0)
{
printf("1\n");
}
else if((a-b)==(a1-b1))
{
printf("1\n");
}
else
{
printf("2\n");
}
}
}
return 0;
}