汉诺塔系列2

http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=2066&cid=1158

View Code
#include <stdio.h>  
#include <math.h>  
long long num;  
int main()  
{  
    int n,k,T,i ;  
    while(scanf("%d",&T)!=EOF)  
    {  
        for(i=0; i<T; i++)  
        {  
           scanf("%d%d",&n,&k);  
           num = pow(2, n-k) ;  
           printf("%lld\n", num);  
        }  
    }  
    return 0;  
}  

 

posted @ 2013-04-20 23:07  yelan@yelan  阅读(321)  评论(0编辑  收藏  举报