summaryrefslogblamecommitdiffstats
path: root/test/ggt.t
blob: 2eeb07af607b42084a5bec50106ba55127d7f97a (plain) (tree)
1
2
3
4
5
6
7
8
9




                            



                  




















                                 
fun main[]
	x = call ggt1[30,40]
	print x
	y = call ggt2[30,40]
	print y
	if x == y
		@0
	end
	@1
end

fun ggt1[x,y]
	while x != y
		if x > y
			x = x - y
		else
			y = y - x
		end
	end
	@x
end

fun ggt2[a,b]
	while b
		x = a
		a = b
		b = x % b
	end
	@a
end