#include<bits/stdc++.h>
using namespace std;
int main()
{
char a[10],b1[10],b2[10];
while(scanf("%s%s%s",a,b1,b2)!=EOF)
{
char *pa_c=strtok(a,".");
int cnt=0;
char *att[4];
while(pa_c!=NULL)
{
att[cnt++]=pa_c;
pa_c=strtok(NULL,".");
}
char *pb1_c=strtok(b1,".");
cnt=0;
char *b1t[4];
while(pb1_c!=NULL)
{
b1t[cnt++]=pb1_c;
pb1_c=strtok(NULL,".");
}
char *pb2_c=strtok(b2,".");
cnt=0;
char *b2t[4];
while(pb2_c!=NULL)
{
b2t[cnt++]=pb2_c;
pb2_c=strtok(NULL,".");
}
int i;
for(i=0;i<4;i++){
if((atoi(b1t[i])&atoi(att[i]))==(atoi(b2t[i])&atoi(att[i])))break;
}
if(i==4)cout<<"0"<<endl;
else cout<<"2"<<endl;
}
return 0;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)