/in/foo.c:1:1: error: unknown type name 'var'
var
^~~
/in/foo.c:2:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
n,i,j,ans,x:longint;
^
/in/foo.c:3:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
s:string;
^
/in/foo.c:4:1: error: unknown type name 'begin'
begin
^~~~~
/in/foo.c:5:3: warning: parameter names (without types) in function declaration
readln(n,x);
^~~~~~
/in/foo.c:6:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
ans:=0;
^
/in/foo.c:7:3: error: expected identifier or '(' before 'for'
for i:=1 to n do
^~~
/in/foo.c:10:7: error: expected identifier or '(' before 'for'
for j:=1 to length(s) do
^~~
/in/foo.c:14:5: warning: data definition has no type or storage class
end;
^~~
/in/foo.c:14:5: warning: type defaults to 'int' in declaration of 'end' [-Wimplicit-int]
/in/foo.c:15:3: warning: data definition has no type or storage class
writeln(ans);
^~~~~~~
/in/foo.c:15:3: warning: type defaults to 'int' in declaration of 'writeln' [-Wimplicit-int]
/in/foo.c:15:3: warning: parameter names (without types) in function declaration
/in/foo.c:16:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
end.
^