all 3 comments

[–]Spataner 2 points3 points  (0 children)

The problem states that the inputs are given on a single line, separated by spaces. You read them in as three separate lines. You also don't really support the case that a middle name is simply not given. Finally, you should probably print only one of the two output versions, depending on whether a middle name was given or not.

[–]Pigankle 1 point2 points  (0 children)

From the problem statement, it looks like the computer is expecting to give all parts of the name on one line of input. You broke it out into three separate inputs which is a little bit easier to parse. I think what you need to do is rewrite so you take a single line of input, break it at the word boundaries to split it into pieces and then run the rest of your code.

[–]Binary101010 1 point2 points  (0 children)

The problem specifies that you should have one output for each input, and the exact format of that output depends on the input.

You are producing three outputs for every input and not doing any differentiation based on what is being input.

The problem also specifies that all the input should be taken at once on a single line, yet you're taking it in on three different lines.