Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
165123 郦辰希 晚餐 C++ Compile Error 0 MS 0 KB 513 2026-11-10 20:39:50

Tests(0/0):


Code:

#include <string> using namespace std; int main() { int N; while (cin >> N) { bool first = true; for (int i = 0; i < N; i++) { string s; cin >> s; if (s == "bowl" || s == "knife" || s == "fork" || s == "chopsticks") { if (!first) cout << " "; cout << s; first = false; } } cout << endl; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:7:12: error: 'cin' was not declared in this scope
     while (cin >> N)
            ^
Main.cc:17:21: error: 'cout' was not declared in this scope
                     cout << " ";
                     ^
Main.cc:18:17: error: 'cout' was not declared in this scope
                 cout << s;
                 ^
Main.cc:22:9: error: 'cout' was not declared in this scope
         cout << endl;
         ^
Main.cc:22:17: error: 'endl' was not declared in this scope
         cout << endl;
                 ^