inceput
intreg x , cmmd, p, r
p <- 1
citeste x
cmmmd = x
cat timp x != 0 executa
citeste x
daca x != 0 atunci
p <- p * x
cat timp x != 0 executa
r <- cmmdc mod x
cmmdc <- x
x <- r
sfarsit cat timp
x <- 1
sfarsit daca
sfarsit cat timp
scrie p div cmmdc
sfarsit