Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- string a, b;
- int main()
- {
- cin >> a >> b;
- for(int i = 0; i < a.size(); i++)
- {
- if(a[i] == '0' && b[i] == '1') a[i] = '1';
- else if(a[i] == '1' && b[i] == '0') a[i] = '1';
- else if(a[i] == '0' && b[i] == '0') a[i] = '0';
- else if(a[i] == '1' && b[i] == '1') a[i] = '0';
- }
- cout << a;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement