Commit ed45a073 authored by uxrog's avatar uxrog
Browse files

Merge branch 'fix/backstab' into 'master'

Remove broken Ackerman.inf.java test

See merge request !50
parents 24c54c37 d943e311
Pipeline #182544 failed with stage
in 20 minutes and 17 seconds
class Ackermann
{
public int ack(int m, int n)
{
if (m == 0)
{
return n + 1;
}
else if((m > 0) && (n == 0))
{
return ack(m - 1, 1);
}
else if((m > 0) && (n > 0))
{
return ack(m - 1, ack(m, n - 1));
}else {
System.out.println(m);
return n + 1;
}
}
public static void main(String[] args)
{
Ackermann a = new Ackermann();
System.out.println(a.ack(2,1));
System.out.println(a.ack(2,2));
System.out.println(a.ack(3,3));
System.out.println(a.ack(3,8));
System.out.println(a.ack(4,4));
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment