SHARE
TWEET

Untitled

tttttt32 Oct 20th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program abc;
  2. var
  3.   n, delitel : integer;
  4.    f:Text;
  5.    function IsCorrectSizechislo(var n1: Integer): Integer;
  6. var
  7.    IsCorrect: boolean;
  8. begin
  9.    IsCorrect := False;
  10.    repeat
  11.     Writeln('vvdtdite chislo ')    ;
  12.           try
  13.          Readln(n1);
  14.          if (n1<0) then
  15.             Writeln('The number must be up to 0!')
  16.          else
  17.             IsCorrect:= True;
  18.       except
  19.          Writeln('Error! Enter a number: ');
  20.       end;
  21.    until IsCorrect;
  22.    Result := n1;
  23. end;
  24.  
  25.    procedure inputfile(n1 :integer );
  26.    var
  27.    f:Text;
  28.    
  29.    begin
  30.           IsCorrectSizechislo(n);
  31.        AssignFile(f, 'F:\file.txt');
  32.        Reset(f);
  33.        readln(f, n1);
  34.        CloseFile(f);
  35.    end;
  36.    function outputfile(var delitel1:integer ) :integer;
  37.    var
  38.    f1:Text;
  39.    begin
  40.        AssignFile(f1, 'F:\filevivod.txt');
  41.        Rewrite(f1);
  42.        Writeln(f1, delitel1);
  43.        CloseFile(f1);
  44.       inputfile( n );
  45.       delitel := 2;
  46.   while n > delitel1 do
  47.     if n mod delitel1 = 0 then
  48.       begin
  49.       WriteLn(delitel1);
  50.       if n mod delitel1 = 0 then n := n div delitel1;
  51.       end
  52.     else
  53.       inc(delitel1);
  54.        WriteLn(delitel1);
  55.   readln;
  56.    end;
  57.    begin
  58.       outputfile (delitel);
  59.  
  60. 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