#include using namespace std; main() { char s[1000]; char *lastline = NULL; while (!cin.fail()) { cin.getline(s, 1000); if (!cin.fail()) { if (lastline != NULL) delete lastline; lastline = new char [strlen(s)+1]; strcpy(lastline, s); } cout << s << endl; } cout << "The last line was '" << lastline << "'" << endl; }