A program that only prints is a poster: it says the same thing every time. Give it input and one program can answer a million different questions — and give it arithmetic and it can work out the answers, which is exactly what every problem on this site asks you to do.
Two directions
The easiest way to remember which is which: the arrows show where the data
goes. And cin needs somewhere to put what it reads, so the variable has to
exist first:
The one difference from school programming
A program written for a person usually asks politely:
A program written for a judge must not. The judge feeds your program the
input, then compares everything it printed with the expected answer, character
by character. How old are you? is not in the expected answer, so a program that
works perfectly gets Wrong Answer.
So the rule for every problem here: print exactly what the problem asks for — no questions, no labels, no extra text.
Reading more than one value
cin >> can be chained, and it reads values in order, skipping any spaces
and line breaks in between. Step through it with the input 7 3:
Because the spaces and line breaks are skipped, it makes no difference whether
the input is 7 3 on one line or 7 and 3 on two. What matters is the
order: cin >> width >> height puts the first number in width and the
second in height — give it 3 7 and it prints 3 x 7.
Printing more than one value
never adds anything you didn't ask for. That is why the program above has with spaces inside the quotes — and it is behind one of the most common Wrong Answers on easy problems:
