Code is running for only first test case but gives wrong answer for n>1

#include
using namespace std;
#include
int main()
{

int k,i;

cin>>k;

for(int g=0;g<k;g++)
{

string s1,s2;

cin.ignore();
getline(cin,s1);
getline(cin,s2);
for(i=0;i<s1.length();i++)
{

   if(s1[i] == s2[i])
    cout<<0;
    else
    cout<<1;
}
i=0;
cout<<endl;

}
}

Use cin for reading string
cin>>s1>>s2;
getline reads the entire line including spaces.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.