#GESP3624. [GESP]L4-202512-Q3624-S

[GESP]L4-202512-Q3624-S

执行下面 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;
}

{{ select(1) }}

  • Happy|New Year
  • Happy| New Year
  • HappyNew Year|
  • Happy|