0_0_20614172_12695.cpp:12:6: error: 'ans' does not name a type
ans; memset(vis,0,sizeof vis); int maxin,p,flag=1; while(flag) { flag=0,maxin=-1,p=0; for(i=1;i<=n;i++) { if(!vis[i]&&maxin<in[i]) { flag=1; maxin=in[i]; p=i; } } if(flag) { vis[p]=1; ans.push_back(p); for(i=1;i<=n;i++) { if(i==p) continue; if(s[p][i]=='1') in[i]--; } } } printf("%d",ans[ans.size()-1]); for(i=ans.size()-2;i>=0;i--) printf(" %d",ans[i]); puts(""); } return 0;}
^
0_0_20614172_12695.cpp:12:24: error: expected constructor, destructor, or type conversion before '(' token
ans; memset(vis,0,sizeof vis); int maxin,p,flag=1; while(flag) { flag=0,maxin=-1,p=0; for(i=1;i<=n;i++) { if(!vis[i]&&maxin<in[i]) { flag=1; maxin=in[i]; p=i; } } if(flag) { vis[p]=1; ans.push_back(p); for(i=1;i<=n;i++) { if(i==p) continue; if(s[p][i]=='1') in[i]--; } } } printf("%d",ans[ans.size()-1]); for(i=ans.size()-2;i>=0;i--) printf(" %d",ans[i]); puts(""); } return 0;}
^
0_0_20614172_12695.cpp:12:78: error: expected unqualified-id before 'while'
ans; memset(vis,0,sizeof vis); int maxin,p,flag=1; while(flag) { flag=0,maxin=-1,p=0; for(i=1;i<=n;i++) { if(!vis[i]&&maxin<in[i]) { flag=1; maxin=in[i]; p=i; } } if(flag) { vis[p]=1; ans.push_back(p); for(i=1;i<=n;i++) { if(i==p) continue; if(s[p][i]=='1') in[i]--; } } } printf("%d",ans[ans.size()-1]); for(i=ans.size()-2;i>=0;i--) printf(" %d",ans[i]); puts(""); } return 0;}
^
|