麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 學院 > 開發設計 > 正文

hdu--1060--Leftmost Digit

2019-11-11 05:05:46
字體:
來源:轉載
供稿:網友

Leftmost Digit Time Limit: 2000/1000 MS (java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 17741 Accepted Submission(s): 6854

PRoblem Description

Given a positive integer N, you should output the leftmost digit of N^N.

Input

The input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow. Each test case contains a single positive integer N(1<=N<=1,000,000,000).

Output

For each test case, you should output the leftmost digit of N^N.

Sample Input

2 3 4

Sample Output

2 2

Hint

In 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.


需要用到科學記數法和對數運算的知識。 我們把num*num的值記作:num*num=a*10^n,其中1

附上ac代碼:

#include<cstdio>#include<cmath>#include<cstring>#include<iostream>#include<algorithm>using namespace std;typedef long long ll;int main(){ int t; scanf ("%d",&t); while (t--) { ll n; int i,j; double x; scanf ("%lld",&n); x = n*log10(n*(1.0)); x -= (ll)x; int a = pow(10.0,x); printf ("%d/n",a); } return 0;}
上一篇:servlet

下一篇:代碼規范重要性

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 久久久久久久亚洲精品 | 国产亚洲精品一区二区三区 | av影片在线观看 | 国产一区二区三区四区波多野结衣 | 成人三区四区 | 黄色一级片在线免费观看 | 国产色爱综合网 | 亚洲人成中文字幕在线观看 | 中文字幕在线看第二 | 深夜激情视频 | 国产乱淫a∨片免费观看 | 草莓视频在线导航 | 中文字幕欧美在线 | 国产理论视频在线观看 | 91网视频在线观看 | 国产成人精品自拍视频 | www久久国产 | 亚洲一级片免费观看 | 一色屋任你操 | 亚洲人成免费 | 成人午夜免费在线观看 | 欧美黄色片免费看 | 久久久久国产成人免费精品免费 | 在线成人看片 | 欧美精品一区二区三区在线 | 免费看毛片网站 | 全黄性性激高免费视频 | 羞羞视频入口 | 青青草成人免费视频在线 | 国产精品亚洲精品久久 | 久久久久久久久久久av | 欧产日产国产精品乱噜噜 | 日韩毛片网站 | 在线观看va| 精品午夜影院 | 欧美日韩大片在线观看 | 日韩一级电影在线观看 | 久久福利小视频 | 精品亚洲综合 | 午夜视频在线免费播放 | 精品成人国产在线观看男人呻吟 |