I'm having trouble reading and differentiating blank lines from input.
Here is the sample input:
number string string string ... number string string ...
Each number represents the beginning of the input and an empty line after the sequence of lines represents the end of the input. A string can be a phrase, not just one word.
My code does the following:
int n; while(cin >> n) {
I tried directly cin -> blank, but that didn't work.
Can someone help me solve this problem?
Thanks!
source share