HOJ 1459 Goldbach's Conjecture
来源:互联网 发布:q币赚钱软件 编辑:程序博客网 时间:2024/04/30 19:49
http://acm.hit.edu.cn/hoj/problem/view?id=1459
Every even number greater than 4 can be written as the sum of two odd primenumbers.
#include<stdio.h>#include<math.h>bool pri(int n);int main(){ int n, i; bool flag; while (scanf("%d", &n) && n) { flag = 0; for (i = 2; i <= n/2; i++) { if(pri(i) && pri(n-i)) { flag = 1; printf("%d = %d + %d\n", n, i, n-i); break; } } /*还没被证伪*/ /* if (flag == 0) printf("Goldbach's conjecture is wrong.\n"); */ } return 0;}bool pri(int n){ int i; for (i = 2; i <= sqrt(n); i++) { if (n % i == 0) return 0; } return 1;}
- HOJ 1459 Goldbach's Conjecture
- Goldbach's Conjecture
- poj2262 Goldbach's Conjecture
- Goldbach's Conjecture
- Goldbach's Conjecture
- HOJ1459 Goldbach's Conjecture
- POJ2262 Goldbach's Conjecture
- 2262 Goldbach's Conjecture
- Goldbach's Conjecture
- POJ2262:Goldbach's Conjecture
- HDU1397:Goldbach's Conjecture
- Goldbach's Conjecture
- Goldbach's Conjecture
- poj2262 Goldbach's Conjecture
- poj_2262 Goldbach's Conjecture
- zoj_1657 Goldbach's Conjecture
- poj2262-Goldbach's Conjecture
- POJ2909:Goldbach's Conjecture
- 最近看到或是总结的一些观点
- HOJ 1496 World Cup Noise
- 《代码大全》读书笔记三
- 学习札记--Struts1 文件上传
- Android调用系统分享功能以及createChooser的使用
- HOJ 1459 Goldbach's Conjecture
- 对我启示的几句话
- Project Euler 45
- C#字符串相关函数(持续更新,绝不TJ)
- TCP大并发短连接造成TIME_WAIT问题解决办法
- 什么是回调函数
- spring源码阅读之IOC2 欢迎点评参考
- Android 实现文件分享功能(共享多个文件)
- HOJ 1446 Binomial Showdown