上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 27 下一页
摘要: 在不知道需要输入多少个数,每个数之间有个空格,当输入换行时结束,如何进行读入操作。#include #include using namespace std;int a[150];int main(){ int n; char op; while(~... 阅读全文
posted @ 2018-08-26 18:40 Mercury_Lc 阅读(83) 评论(0) 推荐(0)
摘要: 在不知道需要输入多少个数,每个数之间有个空格,当输入换行时结束,如何进行读入操作。#include #include using namespace std;int a[150];int main(){ int n; char op; while(~... 阅读全文
posted @ 2018-08-26 18:40 Mercury_Lc 阅读(91) 评论(0) 推荐(0)
摘要: Problem:Given the N integers, you have to find the maximum GCD (greatest common divisor) of every possible pair of these integers.Inpu... 阅读全文
posted @ 2018-08-25 21:26 Mercury_Lc 阅读(84) 评论(0) 推荐(0)
摘要: Problem:Given the N integers, you have to find the maximum GCD (greatest common divisor) of every possible pair of these integers.Inpu... 阅读全文
posted @ 2018-08-25 21:26 Mercury_Lc 阅读(199) 评论(0) 推荐(0)
摘要: int gcd(int x, int y){ return (!y) ? x : gcd( y, x % y );} 阅读全文
posted @ 2018-08-25 21:15 Mercury_Lc 阅读(158) 评论(0) 推荐(0)
摘要: int gcd(int x, int y){ return (!y) ? x : gcd( y, x % y );} 阅读全文
posted @ 2018-08-25 21:15 Mercury_Lc 阅读(113) 评论(0) 推荐(0)
摘要: 转自:http://www.cnblogs.com/gamesky/archive/2013/01/09/2852356.html0、C++的输入输出分为三种:(1)基于控制台的I/O (2)基于文件的I/O (3)基于字符串的I/O ... 阅读全文
posted @ 2018-08-25 21:11 Mercury_Lc 阅读(133) 评论(0) 推荐(0)
摘要: 转自:http://www.cnblogs.com/gamesky/archive/2013/01/09/2852356.html0、C++的输入输出分为三种:(1)基于控制台的I/O (2)基于文件的I/O (3)基于字符串的I/O ... 阅读全文
posted @ 2018-08-25 21:11 Mercury_Lc 阅读(122) 评论(0) 推荐(0)
摘要: 题解:求一个数的次幂,然后输出前三位和后三位,后三位注意有前导0的情况。 后三位直接用快速幂取模求解。 前三位求得时候只需要稍微变形一下,可以把乘过的结果拆成用科学计数法,那么小数部分只有由前面决定,所以取前三位利用double来计算就可以了。#in... 阅读全文
posted @ 2018-08-25 09:04 Mercury_Lc 阅读(108) 评论(0) 推荐(0)
摘要: 欧拉函数:对于一个正整数n,小于n且和n互质的正整数(包括1)的个数,记作φ(n) 。通式: 其中p1, p2……pn为x的所有质因数,x是不为0的整数。φ(1)=1(和1互质的数(小于等于1)就是1本身)。注意:每种质因数只一个。 比如12=2*2*3那么φ(12)... 阅读全文
posted @ 2018-08-24 20:46 Mercury_Lc 阅读(189) 评论(0) 推荐(0)
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 27 下一页