tw3967.pp 655 B

1234567891011121314151617181920212223
  1. { Source provided for Free Pascal Bug Report 3967 }
  2. { Submitted by "luoyonggang" on 2005-05-14 }
  3. { e-mail: [email protected] }
  4. var
  5. i,j,n,m,k,l:longint;
  6. o,p,q,s:int64;
  7. begin
  8. s:=1; p:=1;
  9. for i:=3 downto 1 do begin
  10. if s*(i+2) mod i=0 then s:=s*(i+2) div i else begin
  11. s:=s*(i+2);
  12. p:=p*i;
  13. {The error is here!If we swap the variable i and the variable p then the value of the variable p is right}
  14. {But now the value of the vairable p is zero,you see,the value of the vairable p must be 3}
  15. {The compiler was 1.98}
  16. if p<>3 then
  17. halt(1);
  18. end
  19. end;
  20. if p<>3 then
  21. halt(1);
  22. writeln('ok');
  23. end.