1 / 3
Feb 2023

Any C++ solution? I am not understanding why is my solution getting wrong!!! -_-

  • created

    Feb '23
  • last reply

    Feb '23
  • 2

    replies

  • 396

    views

  • 2

    users

  • 1

    link

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.

PRF02LOOP039

I’ve also added an explanation to the problem text. Does it help?

Suggested Topics

Want to read more? Browse other topics in Online Judge System or view latest topics.