You are correct. It is a bad question. It does not state what the actual problem is in the question body and does not show any attempt to fix or research the problem. Unfortunately, due to the large amount of questions that could be closed, that question must have just been able to slip through. It perfectly fits this close reason in my opinion:
Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example.
[emphasis mine]
The question does have the problem in the title, but it should really be in the question itself as well.
Also, a large issue with the question is that nobody would have any idea what the exact issue with the output was unless they examined the code. At first glance, the question appears to be saying that the entire top portion is the output. Actually, the first line is the prompt, the second line is the input, and the third line is the output. Although this may be able to be resolved by paying careful attention to exactly what the code is doing, the problem statement definitely starts to become murky at this point.