摘要: 题目翻译链接:http://www.nocow.cn/index.php/Translate:URAL/1094题意一直自己没理解。View Code 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 using namespace std; 5 int i; 6 int now; 7 char a[100]; 8 char s[10010]; 9 10 int main ()11 {12 for (i=0;i<80;i++)13 a[i]=' ';14 c 阅读全文
posted @ 2012-04-27 17:08 我们一直在努力 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 要求 N^N的最高位数字设 M = N^Nlog10(M) = N * log10(N)M = 10^(N * log10(N))求的是最高位10^T 当T是整数时他的第一个digit总是1,所以它就应该由小数部分决定.因此,把N * log10(N))的小数部分取出来就可以了设 R = N * log10(N)那么,R的小数部分为 R - (int) (R)这样结果就是 10^(R - (int)R) ,即 (int) pow(10.0,R-(int)R);用int可能会越界,要用__int64View Code 1 #include <cstdio> 2 #include &l 阅读全文
posted @ 2012-04-27 16:21 我们一直在努力 阅读(159) 评论(0) 推荐(0) 编辑