Https://ide.codingblocks.com/s/262004

Why is this code not giving correct output for this test case
4
ab
abc
abcd
abcde

use cin.get() outside the while(n–) loop
image