HDU1996 汉诺塔VI

问题链接HDU1996 汉诺塔VI水题,用C语言编写程序。

问题简述参见上述链接。

问题分析本题实际上是计算3^n。编程中需要注意输出格式。

程序说明(略)

AC的C语言程序如下:

/* HDU1996 汉诺塔VI */

#include<stdio.h>
#include<math.h>

int main (void)
{
    int t, n;

    scanf("%d",&t);
    while(t--)
    {
        scanf("%d", &n);
        printf("%.lf
", pow(3, n));
    }

    return 0;
}


原文地址:https://www.cnblogs.com/tigerisland/p/7564622.html