gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
expanded sample size, first version
[mjc2wsl.git] / samples / alpha-mj-exp / gcd-rek-predef-m3.mj
1 program RekGCD{
3 int gcd(int a, int b)
4 {
5 if (a>b)
6 return gcd(a-b,b);
7 if (a<b)
8 return gcd(a,b-a);
9 return a;
10 }
12 void main()
13 {
14 print(gcd(8,12),3);
15 print(gcd(9,31),3);
16 print(gcd(164,88),3);
17 }
18 }
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner