Can you tell where is the logical error, No test Case working

#include<bits/stdc++.h>
using namespace std;

int main() {
string s1, s2, s3;
int t, i, j, n1, n2;
cin>>t;
for(i=1; i<=t; ++i)
{
cin>>n1>>n2;
s1+=to_string(n1);
s2+=to_string(n2);
for(j=0; j<s1.size(); ++j)
{
if(s1[j]==s2[j])
{
s3+=to_string(0);
}
else{
s3+=to_string(1);
}
}
cout<<s3<<"\n";
s1.clear();
s2.clear();
s3.clear();
}
return 0;
}

@babayaga please share your code using CB IDE

Please reply about the error!!

@babayaga directly take string input instead of taking input and converting it into a string.
You can also append the character ‘0’ and ‘1’ to increase efficiency of the program.

Thank you so much for the assisstance, it worked!!

1 Like

@babayaga dont forget to mark your doubt as resolved :slight_smile:

1 Like

Yes, I already did that :blush: :sweat_smile:

1 Like