why is the test case 4 failing???what is wrong in it?
Test case 4 failing why?
hi @aritrababan2001_a657ea7c1a36b184
Is it clear now… I can see that u have successfully submitted the code and gained full points
yeah…thanks…but can u spot whats wrong in my previous code???
#include
using namespace std;
int main()
{
int test_case,i=1,f1=0;
long long int M,N,c1=1,c2=2;
cin>>test_case;
while(i<=test_case)
{
cin>>M>>N;f1=0;c1=1;c2=2;
while(f1==0)
{
if(c1>M && c2<=N)
{
f1=1;
}
else if(c1<=M && c2>N)
{
f1=2;
}
c1+=2;
c2+=2;
}
if(f1==1)
cout<<"Harshit"<<endl;
else if(f1==2)
cout<<"Aayush"<<endl;
i++;
}
return 0;
}
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.