Java:
package rekurs;
public class rek {
static int rek1(int n) {
if (n==0) return 1;
else return rek1(n-1)*n;
}
public static void main (String[] args) {
int n = Integer.parseInt(args[0]);
int k = Integer.parseInt(args[1]);
int v = rek1(n,k);
System.out.println("Rek=" +v);
}
}
Ich krieg das v einfach nicht hin damit er mir den Wert von rek ausgibt... was mache ich falsch?
Bekomme folgende Fehlermeldung:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method rek1(int) in the type rek is not applicable for the arguments (int, int)
at rekurs.rek.main(rek.java:11)
Weiss aber nicht wie ichs andern lösen soll...