Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  tunner
Language: PASCAL
Code:
program HelloWorld;
var
     a,n  : Byte;
     p,r  : double;
     mind : double;
     x    : integer;

begin
     x:=2;
     repeat
     p:=1000000/x;
     mind:=10000;
     for n:=1 to 255 do begin
          r:=(p+(p*n/255))/(n+1);
          if (r-round(r))<mind then mind:=r-round(r);
     end;
     writeln('P=',p,' N=',n,' mind=',mind);
     x:=x*2;
     until x<257;     
  writeln('Finished......');
  Readln(a);
end.          
          
Comments: