/in/foo.cc: In function 'int find_max()':
/in/foo.cc:2:10: error: 'a' was not declared in this scope
int ans=a[1];
^
/in/foo.cc:3:16: error: 'n' was not declared in this scope
for(int i=2;i<n+1;i++)//遍历寻找最大值
^
/in/foo.cc:4:19: error: 'max' was not declared in this scope
ans=max(ans,a[i]);
^
/in/foo.cc: In function 'void print(int)':
/in/foo.cc:8:17: error: 'n' was not declared in this scope
for(int i=1;i<=n;i++)
^
/in/foo.cc:9:6: error: 'a' was not declared in this scope
if(a[i]==zd) cout<<"No."<<i<<endl;//输出内存最多的箱子
^
/in/foo.cc:9:16: error: 'cout' was not declared in this scope
if(a[i]==zd) cout<<"No."<<i<<endl;//输出内存最多的箱子
^~~~
/in/foo.cc:9:32: error: 'endl' was not declared in this scope
if(a[i]==zd) cout<<"No."<<i<<endl;//输出内存最多的箱子
^~~~
/in/foo.cc:10:5: error: 'a' was not declared in this scope
if(a[n+1]>0) //判断是否有多余的
^
/in/foo.cc:10:7: error: 'n' was not declared in this scope
if(a[n+1]>0) //判断是否有多余的
^
/in/foo.cc:11:3: error: 'cout' was not declared in this scope
cout<<"Others:"<<a[n+1];//输出装不下的
^~~~