There are many times when when need to take input of a string that contains multiple words.
Here, we will learn how to take input of a string that comprises of multiple words. Also, we will learn to clear the input buffer. Your task is to take input of strings and integers and produce the output.
First line of input contains T, number of testcases. For each testcase, there will be three lines of input. First line contains string, second line contains integer, and third line again contains string.
For each testcase, print the variables in same order as taken in input.
Your task is to complete the function getLineAndIgnore() to take input of strings and learn how and when to use cin.ignore().
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.