先读前面的string和数,这是每一行都会有的两次 string s; int val; cin >> s >> val; while(cin.get() != '\n&(392)#39;) { int next; cin >> next; // operation... }