首页 > 代码库 > 杭电2064

杭电2064

 1 #include<stdio.h>
 2 
 3 long long hlt(long long n)
 4 {
 5     long long t;
 6     if(n==1)
 7         t=2;
 8     else
 9         t=2+3*hlt(n-1);
10     return t;
11 }
12 int main()
13 {
14     int n;
15     while(~scanf("%d",&n))
16         printf("%lld\n",hlt(n));
17 }

 

杭电2064