Lab for Automated Reasoning and Analysis LARA

object Factorial {
    def main() : Unit = {
        println(new Fact().computeFactorial(10));        
    }
}
 
class Fact {
    def computeFactorial(num : Int) : Int = {
        var num_aux : Int;
        if (num < 1)
            num_aux = 1;
        else
            num_aux = num * (this.computeFactorial(num - 1));
        return num_aux;
    }
}
 
cc13/toolprog-factorial.tool.txt · Last modified: 2013/09/13 13:57 by ekneuss
 
© EPFL 2018 - Legal notice