You are viewing a single comment's thread. Return to all comments →
This below code will work for c++11 .
using namespace std;
string strings_xor(string s, string t) {
string res = ""; for(int i = 0; i < s.size(); i++) { if(s[i] == t[i]) res = res+'0'; else res = res+'1'; } return res;
}
int main() { string s, t; cin >> s >> t; cout << strings_xor(s, t) << endl; return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
XOR Strings 2
You are viewing a single comment's thread. Return to all comments →
This below code will work for c++11 .
using namespace std;
string strings_xor(string s, string t) {
}
int main() { string s, t; cin >> s >> t; cout << strings_xor(s, t) << endl; return 0; }