第23555题 单选
执行给定C++程序,输出结果是哪一项

执行下面 C++ 程序,会输出( )。

int main() {
    ofstream fout("test.txt");
    fout << "Happy" << endl;
    fout << "New Year";
    fout.close();
    ifstream fin("test.txt");
    string s1, s2;
    fin >> s1;
    getline(fin, s2);
    fin.close();
    cout << s1 << "|" << s2;
    return 0;
}
A

Happy|New Year

B

Happy| New Year

C

HappyNew Year| 

D

Happy| 

提交0次 正确率0.00%
答案解析