hdu1060-Leftmost Digit

来源:互联网 发布:安卓手机安装linux 编辑:程序博客网 时间:2024/05/17 04:42

http://acm.hdu.edu.cn/showproblem.php?pid=1060

#include<iostream>#include<cstdio>#include<cmath>using namespace std ;int main(){double temp ;int Case , n ; __int64 ans ;cin >> Case ;{while( Case-- ){cin >> n ;ans = ( __int64 ) ( n * log10((double) n ) ) ;int sum  =  pow( 10.0 , ( n * log10( ( double ) n ) - ans ) ) ; cout << sum << endl ;}}return 0 ;} 


 

原创粉丝点击