Welcome![Sign In][Sign Up]
Location:
Search - bool pri

Search list

[Data structssushudui

Description: 编制函数prime,用来判断整数n是否为素数:bool prime(int n); 而后编制主函数,任意输入一个大于4的偶数n,找出满足n=i+j的所有数对,其中要求i与j均为素数(通过调用prime来判断素数)。如偶数18可以分解为11+7以及13+5;而偶数80可以分解为:43+37、61+19、67+13、73+7。-establishment prime function, used to judge whether the integer n is prime : bool prime (int n); Then prepare the main function, indiscriminate importation of a greater than even the 4 n, identify meet n = i j few all right, which called i and j are prime (by calling the prime to determine prime numbers). If even 18 can be decomposed to 11 7 and 13 5; And even 80 can be decomposed as follows : 19 43 37,61, 67 13,73 7.
Platform: | Size: 1024 | Author: fisherman | Hits:

CodeBus www.codebus.net