/in/foo.cc:1:1: error: 'var' does not name a type; did you mean 'char'?
var k,l,i:longint;
^~~
char
/in/foo.cc:2:1: error: 'begin' does not name a type
begin
^~~~~
/in/foo.cc:6:2: error: 'l' does not name a type
l:=k;
^
/in/foo.cc:7:2: error: expected unqualified-id before 'if'
if (k<>4)and(k mod 2=0) then l:=k div 2;
^~
/in/foo.cc:8:2: error: expected unqualified-id before 'for'
for i:=3 to trunc(sqrt(k))+1 do
^~~
/in/foo.cc:10:2: error: expected unqualified-id before 'if'
if k mod i=0 then l:=i;
^~
/in/foo.cc:11:2: error: 'l' does not name a type
l:=l-1;
^
/in/foo.cc:12:9: error: expected constructor, destructor, or type conversion before '(' token
writeln(l);
^
/in/foo.cc:13:7: error: expected constructor, destructor, or type conversion before '(' token
close(input);close(output);
^
/in/foo.cc:13:20: error: expected constructor, destructor, or type conversion before '(' token
close(input);close(output);
^
/in/foo.cc:14:1: error: 'end' does not name a type; did you mean 'enum'?
end.
^~~
enum