hdu1060(计算n^n最高位的数字)

来源:互联网 发布:js replacewith 编辑:程序博客网 时间:2024/06/01 20:56

看了别人的,这是怎么想出来的,还可以这样:

#include<stdio.h>#include<math.h>int main(){    int t;    double n;    __int64 m;    scanf("%d",&t);    while(t--)    {        scanf("%I64d",&m);        n=m*log10(m*1.0)-(__int64)(m*log10(m*1.0));        n=pow(10.0,n);        printf("%d\n",(int)n);    }    return 0;}