Created
March 14, 2019 05:53
-
-
Save MarmaladeKnight/bbc0cd4f3f4ef97131cacc52eb8676fd to your computer and use it in GitHub Desktop.
Hotfix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var | |
value, i, j, pow :integer; | |
function func(a, b: integer): integer; | |
var index: integer; | |
begin | |
index := 0; | |
while (a mod b = 0) do | |
begin | |
a := a div b; | |
index := index + 1; | |
end; | |
func := index; | |
end; | |
begin | |
readln(value); | |
i := 2; | |
while (value <> 1) do | |
begin | |
pow := func(value, i); | |
if pow <> 0 then | |
for j := 0 to pow - 1 do | |
begin | |
value := value div i; | |
write(i, ' * '); | |
end; | |
i := i + 1 | |
end; | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment