• + 0 comments

    why is my code not working i mean i am getting the right answer but the compiler says i am wrong.

    include

    include

    using namespace std; int main(){ string str1,str2; cin>>str1>>str2; for (int i = 0; i < str1.length(); i++) { if (str1[i]=='0' && str2[i]=='1') { cout<<1; } else if (str1[i]=='1' && str2[i]=='0') { cout<<1; } else { cout<<0; }
    } return 0; }