- 博客(1)
- 资源 (2)
- 收藏
- 关注
原创 一个程序了解c++ string的常用函数
有代码和注释,组合了常用到的string函数,直接上代码 #include <iostream> #include <string> #include <sstream> using namespace std; int main() { char*p ="adcs";//char* 与string相互转换 string s(p); ...
2019-08-23 10:52:32 579
HDU 2136 Largest prime factor
Largest prime factor
Everybody knows any number can be combined by the prime number.
Now, your task is telling me what position of the largest prime factor.
The position of prime 2 is 1, prime 3 is 2, and prime 5 is 3, etc.
Specially, LPF(1) = 0.
Each line will contain one integer n(0 < n < 1000000).
Output the LPF(n).
2015-06-19
素数筛法打表
素数筛法打表
//j=i<<1等价于 j=i*2,即j是i的两倍,而最后的j+=i,则表示下一个循环j是i的3倍,接着4倍。。。
//i的所有2~N倍数肯定都不是素数,因此将flag置为0,直到最后一位。
2015-06-18
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人