Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何输入
1 2 4 5 4 2 3 1 2 1 1 1
到cmd?我不想在按“Enter”时读取“1 2”,而是转到下一行并写“4 5 4 2 3”
我只是在这里做猜测,因为你真的没有给我太多的工作,但你是否考虑过使用转义字符 () 来转义换行符?
或者,只需创建一个循环,直到您输入一个空行:
string line; do { cin >> line; } while (line.size() > 0);