题目:
如何用C语言验证2000以内的哥德巴赫猜想,对于任何大于4的偶数均可以分解为两个素数之和.
我是大一新生,代码不能太复杂
解答:
//首先生成质数表,然后双重循环输出2000以内所有偶数的两个质数和的形式
#include
#include
bool isPrime(int n)
{
\x09int i;
\x09for (i = 2 ; i
再问: 我还没学到数组,老师让用循环做,能不能代码再简单一点
再答: 这已经够简单了。。而且就是用循环做的,数组只是辅助存储,可以去掉 如下: #include #include int isPrime(int n) { int i; for (i = 2 ; i
猜你喜欢:
1.请问忌廉可否代替奶油做冰淇淋
2.The ____ (speak)words made the young people very excited .这道
3.这句英语写的对吗The sting of a bee left me a searing pain on my leck
4.小学英语没学,上初中英语能跟上吗