if 语句: if 语句: if 语句被称为分支语句(branching statement)或选择语句(selection statement) if 语句的通用形式: 如果 expression 为真,则执行 statement;否则,跳过 statement 与 while 循环一样,stat ...
分类:
其他好文 时间:
2018-05-12 03:14:00
阅读次数:
186
内容摘要: 素数(prime number)到底是啥数: 定义: 在大于1的自然数中,除了1和它本身以外不能再被其他数所整除。 实例化定义: 3是素数,因为它不可以被除了“1”以及自身“3”之外的数所整除。 10不是素数,因为它除了“1”以及自身“10”之外,还可以被"2",“5”等数字所整除,所以 ...
分类:
其他好文 时间:
2018-05-11 20:10:51
阅读次数:
433
Problem Description Given a number N, you are asked to count the number of integers between A and B inclusive which are relatively prime to N.Two inte ...
分类:
其他好文 时间:
2018-05-09 19:30:40
阅读次数:
163
Description The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication te ...
分类:
Web程序 时间:
2018-05-05 21:45:55
阅读次数:
255
先上代码: #include<stdio.h> #include<iostream> #include<string.h> #include<time.h> using namespace std; int prime[10000001];//存素数 bool vis[10000001];//保证不 ...
分类:
其他好文 时间:
2018-05-05 20:36:19
阅读次数:
166
C++ Primer(中英文版)(第4、5、6版): 链接: https://pan.baidu.com/s/1iEAcMsdcXWcA7VJG8SmRfA 密码: i6g9 C++编程思想(Thinking In C++): 链接: https://pan.baidu.com/s/1HEZfSKa ...
分类:
编程语言 时间:
2018-05-04 19:05:12
阅读次数:
164
1 判断一个数是否为素数 对于判断一个数m是否为素数,最朴素的方式是按照素数的定义,试除以从2开始到m-1的整数,倘若无一例外地不能整除,则该数必为素数。 下面来深究一下: 在数学上,假定某个整数m不是素数,则一定可以表示成两个因子的积: 所以必定有一个因子不大于m的平方根(即这里所说的 i)。故判 ...
分类:
编程语言 时间:
2018-05-04 17:00:38
阅读次数:
231
2-1注意: 1、c++只规定了各类型的内存最小尺寸,同时字节数至少 long long >=long>=int>=short; 2、字符型分为 char、signed char和unsigned char。类型char 实际会表现为上述哪种类型,具体由编译器决定;VS2013中,char == s ...
分类:
编程语言 时间:
2018-05-03 23:27:10
阅读次数:
229
Leetcode ugly number set (3 now) new ugly number is generated by multiplying a prime with previous generated ugly numbe Is ugly number or not //simula ...
分类:
其他好文 时间:
2018-05-03 12:45:44
阅读次数:
147