本文主要是介绍hdu-2013-蟠桃记,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
#include<stdio.h>int f(int n)
{
int c;
if(n==1)
c=1;
else
c=2*f(n-1)+2;
return c;
}
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
printf("%d\n",f(n));
}
return 0;
}
这篇关于hdu-2013-蟠桃记的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!