Problem in getting started

it’s a rather simple code: read inputs and output till the entered is not equal to 42.

#include
using namespace std;

int main() {
int n;

while(1)
{
    scanf("%d",&n);
    if(n==42)
        break;
    else
        {cout<<n<<"\n";
            fflush(stdout);
        }
}
return 0;

}

I get SIGSTP and some same, garbage value in the output.
Please help, due to such issues I gave up trying on codechef a long time ago.
Is it some problem with my account? My machine?

Are you trying to “Run” without Providing “Custom Input”?

1 Like

:sweat_smile: yes, thank you, I didn’t know I had to provide custom input to test as well. And sorry for such silly doubt, I just started.

1 Like

No problem; it’s bad User Interface Design on Codechef’s part, frankly :slight_smile:

1 Like