runtime error[ACMKAPD]

it is giving runtime error each time… i made small changes but all in vein… is my solution
problem is:

and i always waste my time in debugging my codes rather than making them…

[any useful tips so that it’s AC at one go???]

@hitesh091 You are using scanf() function to read a line of input, instead you should use gets(). scanf() reads until a whitespace character occurs, on the other hand gets() reads a line until newline or EOF character occurs.

Here is ideone link to your AC code.


Hope it helps, Best Luck :slight_smile:

1 Like

i replaced scanf with gets in my code… but it’s still giving runtime error at codechef?

why runtime error at codechef…