This problem is unusual in SPOJ, in that it puts out a prompt as though it’s being run by an interactive user.
So, you also need to write the prompt, (with no new line), read the value, then either write an error message or display the information message and the triangle.
(Because this isn’t really an interactive program, and input and output are from/to separate files, you can actually read the input value before writing the prompt - it’s all the same in SPOJ land. But you do still need to write the prompt.)
If you’re still having trouble, post your code here and I’ll see if I can spot anything.