Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include<iostream>
using namespace std;
int main(){
const int MAX = 100;
char *a = new char[MAX];char *b = new char[MAX];char *r = new char[MAX];
cin>>a;
cin>>b;
int i = 0;
while(a[i] != '\0'){
r[i] = ((a[i] - '0') ^ (b[i] - '0')) + '0';
cout<<r[i];
i++;
}
delete a;
delete b;
delete r;
}
Copy The Code &
Try With Live Editor
Input
1010100
0100101
0100101
Output
1110001
Demonstration
Codeforcess Solution 61-A A. Ultra-Fast Mathematician ,C++, Java, Js and Python ,61-A,odeforcess Solution