📄 ackfunction.cpp
字号:
// ACKFunction.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
// ACKfunction.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
using namespace std;
unsigned int count;
long int ACK(unsigned int m,unsigned int n)
{
int p;
if(m==0)
{
count++;
return n+1;
}
else if(n==0)
{
count++;
return ACK(m-1,1);
}
else
{
count++;
p=ACK(m,n-1);
return ACK(m-1,p) ;
}
}
void main()
{
unsigned int m;
unsigned int n;
unsigned int x;
count=0;
cout<<"input m:";
cin>>m;
cout<<"input n:";
cin>>n;
x=ACK(m,n);
cout<<"the result is:"<<x<<endl;
cout<<"count="<<count<<endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -