Advertisement
dllbridge

Untitled

Nov 24th, 2022
668
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. string a, b, c;
  6.  
  7. int main()
  8. {
  9.     cin >> a >> b;
  10.    
  11.     for(long long i = 0; i < a.size(); i++)
  12.     {
  13.         if(a[i] == '0' && b[i] == '1') c[i] = '1';
  14.         if(a[i] == '1' && b[i] == '0') c[i] = '1';
  15.         if(a[i] == '0' && b[i] == '0') c[i] = '0';
  16.         if(a[i] == '1' && b[i] == '1') c[i] = '0';
  17.     }
  18.    
  19.     for(long long i = 0; i < a.size(); i++)cout<<c[i];
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement