please help codechef compiler is giving compilation error but there is no such problem on local machine.
#include
using namespace std;
int main()
{
int a=0;
while(a!=42 && a>=0 && a<100)
{
cin>>a;
if(a!=42)
cout<<a<<endl;
}
return 0;
}
please help codechef compiler is giving compilation error but there is no such problem on local machine.
#include
using namespace std;
int main()
{
int a=0;
while(a!=42 && a>=0 && a<100)
{
cin>>a;
if(a!=42)
cout<<a<<endl;
}
return 0;
}
That’s because you’re submitting you C++ code in KOTLIN. I don’t know if C++ code can be compiled with KOTLIN but apparently not.
However your C++ submission also failed because you are exiting the loop if a
is negative. That restriction isn’t mentioned anywhere and the editorialist’s solution hints that numbers can be negative too.
Some advice for future posts:
I just submitted your code and got AC
the server is working correctly
It looks like you are submitting through www.codechef.com/ide. Maybe you can try submitting through www.codechef.com/submit/TEST ?
You can upload a file and select a language there. I suggest you don’t copy paste your code in the editor there just to see what happens.
If it works here and not in the IDE then there is a problem with the IDE I guess. If it doesn’t work either way, there is a problem on your end.