Created
March 14, 2019 04:01
-
-
Save MarmaladeKnight/bebbc008d6bf2f129df0d02b4b762146 to your computer and use it in GitHub Desktop.
Танина задача
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, 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); | |
for i := 2 to value div 2 do | |
begin | |
pow := func(value, i); | |
if pow <> 0 then | |
writeln(i, ' в степени ', pow); | |
end; | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment