why this code takes one less input from standard input? : <p>Giving input as:
    <pre>Input:
    3
    1 2 3 
    4 5 6 7
    8 9 10 11 12
Expected Output:
    1 2 3
    4 5 6 7
    8 9 10 11 12
</pre>
    But it is giving the Output-
    <pre> 1 2 3
 4 5 6 7
</pre>
    Why it is not giving the last line ? Is there any mistake in my code?</p>

<pre><code>#include &lt;iostream&gt;
#include&lt;stdlib.h&gt;
#include&lt;string.h&gt;
using namespace std;

int main() {
int t;
cin&gt;&gt;t;
while(t--)
{   string str;
    getline(cin,str,'\n');
    cout&lt;&lt;str&lt;&lt;endl;
}
return 0;
}
</code></pre>
