标签:des style java color os strong io for
2 3 4
2 2HintIn the first case, 3 * 3 * 3 = 27, so the leftmost digit is 2. In the second case, 4 * 4 * 4 * 4 = 256, so the leftmost digit is 2.
要了解 log的用法、pow函数的用法
#include<stdio.h> #include<math.h> int main() { int T,a; double m; scanf("%d",&T); while(T--) { __int64 N; double a; scanf("%I64d",&N); m=N*log10((double)N)-(__int64)(N*log10((double)N)); a=pow(10.0,m); printf("%d\n",(int)a); } return 0;
HDU 1060 Leftmost Digit,布布扣,bubuko.com
标签:des style java color os strong io for
原文地址:http://blog.csdn.net/qq_16767427/article/details/38237177