1 / 2
Jan 2006

I submited problem Triangle from Centroid and get compilation error
.It said that
tested.pas(2,21) Warning: Comment level 2 found
tested.pas(7,6) Warning: Comment level 2 found
tested.pas(8,43) Warning: Comment level 3 found
tested.pas(24,6) Warning: Comment level 3 found
tested.pas(25,22) Warning: Comment level 4 found
tested.pas(26,4) Fatal: Unexpected end of file
tested.pas(26,4) Error: Compilation aborted
Error: /usr/bin/ppc386 returned an error exitcode (normal if you did not specifiy a source file to be compiled)
i can't understand why ,when I compile my program in my computer there's nothing wrong,and here is my code

const {fi = 'vu.inp';
fo = 'vu.out';{}
var
sotest,run : integer;
kc,s,a,b,c,r,ha,hb,hc : real;
begin
{assign (input,fi); reset (input);
assign (output,fo); rewrite (output);{}

 readln (sotest);
 for run :=1 to sotest do
 begin
      readln (a,ha,hb,hc);
      S :=ha*3*a/2;
      b :=2*S/(3*hb);
      c :=2*S/(3*hc);
      R :=(a*b*c)/(4*S);
      kc :=(sqr (R) - (sqr(a) + sqr (b) + sqr (c))/9);
      kc :=abs (kc);
      if kc > 0 then kc :=2*sqrt (kc);
      writeln (S:0:3,#32,kc : 0: 3);
 end;

 {close  (input);
 close  (output);{}

end.

  • created

    Jan '06
  • last reply

    Jan '06
  • 1

    reply

  • 1.1k

    views

  • 2

    users

Disclaimer: I don't really know Pascal.

{ ... { ... { ...

[quote="hammerfall"]i can't understand why ,when I compile my program in my computer there's nothing wrong,and here is my code

const {fi = 'vu.inp';
      fo = 'vu.out';{}

[/quote]

And here's the problem. Your compiler doesn't support nested comments, so it sees {...{} as a single comment. ppc386 thinks that {} is a single embedded comment, contained in another comment that starts in line 1 (and doesn't end anywhere). So you get an error at the end of the file because the first comment isn't terminated.