// 已知文件test.txt的内容如下: // Good Morning! // Good Night! // Good Luck! // 补充下面程序,使得输出结果如下: // 1:Good Morning! // 2:Good Night! // 3:Good Luck! #include #include using namespace std; const int size = 100; int main() { char buf[::size]; // _______________ ifstream in("test.txt", ios::in); int i = 1; while (in.getline(buf, ::size)) { // ____________________ cout << i <<":" << buf << endl; i++; } }