Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
159003 格林老师 晚餐 C++ Compile Error 0 MS 0 KB 428 2026-08-24 21:37:57

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int N; while (1){ cin>>N; string a[N]={}; string arr[4]={bowl,knife,fork,chopsticks}; for (int i=0;i<N;i++){ cin>>a[i]; for (int j=0;j<4;j++){ if (arr[j]==a[i]){ cout<<arr[j]<<" "; } } } cout<<endl; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:24: error: 'bowl' was not declared in this scope
         string arr[4]={bowl,knife,fork,chopsticks};
                        ^
Main.cc:8:29: error: 'knife' was not declared in this scope
         string arr[4]={bowl,knife,fork,chopsticks};
                             ^
Main.cc:8:35: error: 'fork' was not declared in this scope
         string arr[4]={bowl,knife,fork,chopsticks};
                                   ^
Main.cc:8:40: error: 'chopsticks' was not declared in this scope
         string arr[4]={bowl,knife,fork,chopsticks};
                                        ^