/in/foo.cc:5:5: error: 'string' does not name a type
string name;
^~~~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:10:5: error: 'cin' was not declared in this scope
cin>>n>>m;
^~~
/in/foo.cc:13:30: error: 'struct node' has no member named 'name'; did you mean 'node'?
cin>>a[i].head>>a[i].name;
^~~~
/in/foo.cc:24:5: error: 'cout' was not declared in this scope
cout<<a[now].name<<endl;
^~~~
/in/foo.cc:24:18: error: 'struct node' has no member named 'name'; did you mean 'node'?
cout<<a[now].name<<endl;
^~~~
/in/foo.cc:24:24: error: 'endl' was not declared in this scope
cout<<a[now].name<<endl;
^~~~