杭电1996

 1 //找规律。。。
 2 #include<stdio.h>
 3 long long a[30];
 4 void cus(int t,long long x)
 5 {
 6     if(t>=30)
 7         return ;
 8     a[t]=x;
 9     cus(t+1,3*x);
10 }
11 
12 int main()
13 {
14     cus(1,3);
15     int n;
16     scanf("%d",&n);
17     while(n--)
18     {
19         int m;
20         scanf("%d",&m);
21         printf("%lld\n",a[m]);
22     }
23 }

 

posted @ 2017-02-10 18:44  Posase  阅读(191)  评论(0编辑  收藏  举报