nefu 66 最左边的数

题目:http://acm.nefu.edu.cn/test/problemshow.php?problem_id=66

思路:直接对10取余,剩下的化简就可以到用科学技术法表示的该数的首位

 

复制代码
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
using namespace std;
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        long long n;
        scanf("%lld",&n);
        int ans=(int)pow(10,n*log10(n)-(int)(n*log10(n)));
        cout<<ans<<endl;
    }
    return 0;
}
View Code
复制代码

 

posted @   over_flow  阅读(104)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示