蒟蒻在线求教,这题用递归怎么做?我哪出问题了?
查看原帖
蒟蒻在线求教,这题用递归怎么做?我哪出问题了?
353433
绘梨衣の花枫楼主2020/6/20 10:17
#include<bits/stdc++.h>
using namespace std;
long long tz(int n)
{
	if(n==1) return 4;
	return 2*tz(n+1);
}
int main()
{
	int n;
	cin>>n;
	cout<<tz(n)<<endl;
	return 0;
}
2020/6/20 10:17
加载中...