0

Hi everyone. How do u write a program that takes in a string with multiple lines?

So i have to write a program that takes in a string with multiple lines. And terminates after reading the last line. Apparently I have to use EOF, I searched the net but I still don't get it. please help https://code.sololearn.com/cY3IvgFC57bQ/?ref=app

27th Mar 2018, 11:46 AM
Whiless
Whiless - avatar
1 ответ
0
You can use a string array, or a vector. In loop, get input per word and push in to vector or in array: loop{ cin >> input; s[i] = input; }
27th Mar 2018, 12:18 PM
Jonathan T Rantael
Jonathan T Rantael - avatar