Init next project
This commit is contained in:
12
Project-02/triplaprograms/ggT_euclid_iter.tripla
Normal file
12
Project-02/triplaprograms/ggT_euclid_iter.tripla
Normal file
@@ -0,0 +1,12 @@
|
||||
let ggT(a, b) {
|
||||
if (a == b) then
|
||||
a
|
||||
else
|
||||
do {
|
||||
if (a > b) then
|
||||
a = a - b
|
||||
else
|
||||
b = b - a
|
||||
} while (a != b);
|
||||
a
|
||||
} in ggT(3528, 3780) // result should be 252
|
||||
Reference in New Issue
Block a user