fork download
  1. object Gcd{
  2. def gcd(m : Int, n : Int, x : Int, y : Int): Int = {
  3. if(m < n){
  4. return gcd(n,m,y,x);
  5. }
  6. if(m % n == 0){
  7. println(n);
  8. return n;
  9. }
  10. return gcd((m%n), n, x, (y+m/n));
  11. }
  12. // Main function
  13. def main(args : Array[ String ]) = {
  14. val m = args(0).toInt;
  15. val n = args(1).toInt;
  16. gcd(n, m , 1, 1);
  17. }
  18. }
  19.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
spoj: The program compiled successfully, but Main.class was not found.
      Class Main should contain method: def main(args: Array[String]).
stdout
Standard output is empty