当前位置:网站首页>Goldbach conjecture C language
Goldbach conjecture C language
2022-07-07 08:52:00 【Please Sit Down】
#include <stdio.h>
#include <conio.h>
int prime(int n){
int k, flag = 1;
for (k = 2; k <= n/2 + 1; k++)
if (n % k == 0){
flag = 0 ;
break;
}
return flag;
}
void main(){
int num, a;
// clrscr();
do{
printf("Please input an even number:");
scanf("%d", &num);
} while (num <= 6 || num % 2 == 1);
for (a = 2; a <= num / 2 + 1; a++)
if (prime(a) && prime(num - a))
printf("\n %d = %d + %d ", num, a, num - a);
}
边栏推荐
- Shell script for changing the current folder and the file date under the folder
- let const
- Greenplum6.x搭建_安装
- Test pits - what test points should be paid attention to when adding fields to existing interfaces (or database tables)?
- Greenplum6.x重新初始化
- Introduction to data fragmentation
- 【MySQL】数据库进阶之触发器内容详解
- let const
- 如何在图片的目标中添加目标的mask
- Why choose cloud native database
猜你喜欢
数据分析方法论与前人经验总结2【笔记干货】
LeetCode 736. Lisp 语法解析
What is the method of manual wiring in PCB design in 22protel DXP_ Chengdu electromechanical Development Undertaking
[Yu Yue education] higher vocational English reference materials of Nanjing Polytechnic University
Count sort (diagram)
Rapid integration of authentication services - harmonyos platform
Data analysis methodology and previous experience summary 2 [notes dry goods]
Markdown editor Use of MD plug-in
How to realize sliding operation component in fast application
【踩坑】nacos注册一直连接localhost:8848,no available server
随机推荐
如何在HarmonyOS应用中集成App Linking服务
xray的简单使用
路由信息协议——RIP
为不同类型设备构建应用的三大更新 | 2022 I/O 重点回顾
MySQL主从延迟的解决方案
Greenplum6.x搭建_安装
模拟卷Leetcode【普通】1557. 可以到达所有点的最少点数目
String operation
数字三角形模型 AcWing 275. 传纸条
[Yugong series] February 2022 U3D full stack class 007 - production and setting skybox resources
oracle一次性说清楚,多种分隔符的一个字段拆分多行,再多行多列多种分隔符拆多行,最终处理超亿亿。。亿级别数据量
Redis fault handling "can't save in background: fork: cannot allocate memory“
Image segmentation in opencv
Tronapi wave field interface - source code without encryption - can be opened twice - interface document attached - package based on thinkphp5 - detailed guidance of the author - July 6, 2022 - Novice
为什么要选择云原生数据库
Markdown editor Use of MD plug-in
Digital triangle model acwing 1027 Grid access
Frequently Asked Coding Problems
Why choose cloud native database
Greenplum6.x监控软件搭建