Advertisement
Racknoss

Small number on simple v1.1

Jun 29th, 2015
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.27 KB | None | 0 0
  1. var
  2. n:int64;
  3. c:boolean;
  4. i:int64;
  5. label 1 ,2;
  6. Begin
  7. readln(n);
  8. 1:i:=1;
  9. c:=false;
  10. repeat
  11.  i:=i+1;
  12.   if i>sqrt(n) then begin write(n); goto 2; end;
  13.  if n mod i = 0 then begin c:=true; write(i,' '); n:=n div i; end;
  14. until(c=true);
  15. if not(n=1) then goto 1;
  16. 2:end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement