/in/foo.c:3:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
template <class X> inline void read(X &x){
^
/in/foo.c:17:7: error: variably modified 'f1' at file scope
int n,f1[M],w[M],f2[M],f3[M],son[M][M],num[M];
^~
/in/foo.c:17:13: error: variably modified 'w' at file scope
int n,f1[M],w[M],f2[M],f3[M],son[M][M],num[M];
^
/in/foo.c:17:18: error: variably modified 'f2' at file scope
int n,f1[M],w[M],f2[M],f3[M],son[M][M],num[M];
^~
/in/foo.c:17:24: error: variably modified 'f3' at file scope
int n,f1[M],w[M],f2[M],f3[M],son[M][M],num[M];
^~
/in/foo.c:17:30: error: variably modified 'son' at file scope
int n,f1[M],w[M],f2[M],f3[M],son[M][M],num[M];
^~~
/in/foo.c:17:30: error: variably modified 'son' at file scope
/in/foo.c:17:40: error: variably modified 'num' at file scope
int n,f1[M],w[M],f2[M],f3[M],son[M][M],num[M];
^~~
/in/foo.c:18:1: error: unknown type name 'bool'
bool fa[M];
^~~~
/in/foo.c:18:6: error: variably modified 'fa' at file scope
bool fa[M];
^~
/in/foo.c: In function 'main':
/in/foo.c:43:2: warning: implicit declaration of function 'read' [-Wimplicit-function-declaration]
read(n);
^~~~