daily pastebin goal
32%
SHARE
TWEET

Untitled

a guest Jan 14th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. procedure Task1;
  2.  
  3. var
  4.     num: Integer;
  5.    i: Integer;
  6. begin
  7.     Writeln('Задача: Разложить число на простые множители');
  8.    Write('Введите число... ');
  9.    Readln(num);
  10.    Write(num, ' = 1');
  11.    i := 2;
  12.    while (num <> 1) do
  13.    begin
  14.     if (num mod i) = 0 then
  15.         begin
  16.         num := num div i;
  17.          Write('*', i);
  18.     end
  19.       else
  20.         if i = 2 then
  21.             i := 3
  22.         else
  23.             Inc(i,2);  
  24.    end;
  25.    Writeln;
  26. 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