Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int binary(string n)
- {
- string s=n;
- //cout<<"string is "<<s<<endl;
- int i,j,a,sum=0,base=1;
- int len=s.length();
- for(i=len-1;i>=0;i--)
- {
- if(s[i]=='1')
- {
- sum+=base;
- }
- base=base*2;
- }
- // cout<<sum<<endl;
- return sum;
- }
- int main()
- {
- int t,i,j,k,a,b,c;
- string s1,s2;
- cin>>t;
- for(k=1;k<=t;k++){
- cin>>s1>>s2;
- a=binary(s1);
- b=binary(s2);
- if(__gcd(a,b)==1)
- printf("Pair #%d: Love is not all you need!\n",k);
- else
- printf("Pair #%d: All you need is love!\n",k);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement