/in/foo.c:7:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
template <class X> inline void read(X &x){
^
/in/foo.c:21: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:21: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:21: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:21: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:21: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:21:30: error: variably modified 'son' at file scope
/in/foo.c:21: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:22:1: error: unknown type name 'bool'
bool fa[M];
^~~~
/in/foo.c:22: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);
^~~~