S001-AC.cc
296 Bytes
#include <iostream>
using namespace std;
string read(int* n)
{
string str, prev;
cin >> str;
if(cin.eof())
{
return "";
}
prev = read(n);
if(!(*n))
{
return prev;
}
(*n)--;
return prev + str + "\n";
}
int main()
{
int n;
cin >> n;
if(n)
{
cout << read(&n);
}
return 0;
}