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-proc-input.mj
diff --git a/samples/alpha-mj-exp/gcd-proc-input.mj b/samples/alpha-mj-exp/gcd-proc-input.mj
new file mode 100644 (file)
index 0000000..ce38aaa
--- /dev/null
@@ -0,0 +1,26 @@
+program procgcdinput{
+
+       int gcd(int a, int b)
+       {
+               while (a != b) {
+                       if (a>b) 
+                               a = a-b;
+                       if (a<b)
+                               b = b-a;
+               }
+               return a;
+       }
+       
+       void main()
+               int a;
+               int b;
+       {
+               print('a');
+               print('?');
+               read(a);
+               print('b');
+               print('?');
+               read(b);
+               print(gcd(a,b),3);
+       }
+}
\ No newline at end of file
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner