/in/foo.c:3:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
map<char,int>mp;
^
/in/foo.c:4:1: error: unknown type name 'bool'
bool cmp(int x,int y)
^~~~
/in/foo.c: In function 'cmp':
/in/foo.c:7:12: error: 'mp' undeclared (first use in this function)
if(mp[a[x][i]]<mp[a[y][i]]) return 1;
^~
/in/foo.c:7:12: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c: In function 'main':
/in/foo.c:17:9: error: 'cin' undeclared (first use in this function)
cin>>t;
^~~
/in/foo.c:18:9: error: 'mp' undeclared (first use in this function)
mp[t]=i;
^~
/in/foo.c:20:5: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
scanf("%d",&n);
^~~~~
/in/foo.c:20:5: warning: incompatible implicit declaration of built-in function 'scanf'
/in/foo.c:20:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
/in/foo.c:26:5: warning: implicit declaration of function 'sort' [-Wimplicit-function-declaration]
sort(num+1,num+n+1,cmp);
^~~~
/in/foo.c:27:36: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
if(k==1) for(int i=1;i<=n;i++) printf("%s\n",a[num[i]]);
^~~~~~
/in/foo.c:27:36: warning: incompatible implicit declaration of built-in function 'printf'
/in/foo.c:27:36: note: include '<stdio.h>' or provide a declaration of 'printf'
/in/foo.c:28:32: warning: incompatible implicit declaration of built-in function 'printf'
else for(int i=n;i>=1;i--) printf("%s\n",a[num[i]]);
^~~~~~
/in/foo.c:28:32: note: include '<stdio.h>' or provide a declaration of 'printf'