You are viewing a single comment's thread. Return to all comments →
C++20 version does not compile for some reason, why?
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> 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 += '0'; else 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 →
C++20 version does not compile for some reason, why?