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
1 Respuesta
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;
}