标签:ble rap src this jpg class 图片 osi 技术分享
package other;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
public class bin_1
{
public static void main(String[] args) throws IOException
{
Ackerman myAckerman=new Ackerman(10, 2);
}
}
class Ackerman
{
int m;
int n;
int result;
public Ackerman(int n,int m) throws IOException
{
this.n=n;
this.m=m;
result=ackerman(n,m);
display();
}
public int ackerman(int n,int m)
{
if(n==1&&m==0)
{
return 2;
}
if(n==0&&m>=0)
{
return 1;
}
if(n>=2&&m==0)
{
return n+2;
}
return ackerman(ackerman(n-1,m),m-1);
}
public void display() throws IOException
{
BufferedWriter fout=new BufferedWriter(new FileWriter("out.txt"));
fout.write("result="+result);
fout.flush();
}
}
Ackerman myAckerman=new Ackerman(10, 2);
标签:ble rap src this jpg class 图片 osi 技术分享
原文地址:https://www.cnblogs.com/Howbin/p/9942018.html