Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int a,b,c,d,e,f,g,h,n,i,x,r,s;
- scanf("%d",&n);
- for(i=1;i<=n;i++){
- scanf("%d%*c%d%*c%d%*c%d",&a,&b,&c,&d);
- scanf("%d%*c%d%*c%d%*c%d",&e,&f,&g,&h);
- s=0;
- x=1;
- while(a>0){
- s=s+((a%2)*x);
- x=x*10;
- a=a/2;
- }
- a=s;
- s=0;
- x=1;
- while(b>0){
- s=s+((b%2)*x);
- x=x*10;
- b=b/2;
- }
- b=s;
- s=0;
- x=1;
- while(c>0){
- s=s+((c%2)*x);
- x=x*10;
- c=c/2;
- }
- c=s;
- s=0;
- x=1;
- while(d>0){
- s=s+((d%2)*x);
- x=x*10;
- d=d/2;
- }
- d=s;
- if(a==e && b==f && c==g && d==h)
- printf("Case %d: Yes\n",i);
- else
- printf("Case %d: No\n",i);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement