#include <iostream>
#include <limits>
#include <fstream>
using namespace std;
int main() {
int a;
int index = 0;
fstream fout;
fout.open("testBuffer.txt", ios::app);
if (!fout){
cerr<<"the file open error"<<endl;
}else {
while (cin >> a) {
fout << a << endl;
index++;
if (index == 5) {
break;
}
}
cin.ignore(numeric_limits<std::streamsize>::max(), '\n');
char ch;
cin >> ch;
fout << "the last char is: " << ch << endl;
fout.close();
return 0;
}
}