SHARE
TWEET

FNST

finalshare Aug 24th, 2015 (edited) 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. uses crt;
  2. var
  3.         snt: array [1..15] of Longword;
  4.         save: real;
  5.         tich,i,j,count,m:Longword       ;
  6. function F(x:longword):real;
  7. var
  8. k:byte;
  9. begin
  10. f:=1;
  11. for k:=1 to x do f:=f*snt[k];
  12. end;
  13. function ktsnt(x:Longword):boolean;
  14. var
  15. k:Longword;
  16. begin
  17. ktsnt:=true;
  18. if x<2 then ktsnt:=false else
  19. if x=2 then ktsnt:=true else
  20. for k:=2 to trunc(sqrt(x)) do
  21.         if  (x mod k = 0) then ktsnt:=false;
  22. end;
  23.  
  24. begin
  25. clrscr;
  26. j:=0;
  27. readln(m);
  28. for i:=m downto 1 do
  29. if ktsnt(i) then break;
  30. writeln(i);
  31. for i:=1 to 30 do
  32.                 if ktsnt(i) then begin inc(j);snt[j]:=i; end;
  33. for i:=1 to 8 do
  34.         for j:=1 to 8 do
  35.         begin
  36.         save:=F(i)*F(j);
  37.         if save = m then begin write(snt[i+1],' ',snt[j+1]); exit; end;
  38.         end;
  39. readln;
  40. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top