当前位置:网站首页>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);
}
边栏推荐
- LeetCode 736. Lisp 语法解析
- Why choose cloud native database
- cmake命令行使用
- [Yu Yue education] higher vocational English reference materials of Nanjing Polytechnic University
- 详解华为应用市场2022年逐步减少32位包体上架应用和策略
- What are the advantages of commas in conditional statements- What is the advantage of commas in a conditional statement?
- mysql分区讲解及操作语句
- 最长上升子序列模型 AcWing 1017. 怪盗基德的滑翔翼
- selenium自动化集成,八年测试经验软测工程师,一篇文章带你学懂
- opencv 将16位图像数据转为8位、8转16
猜你喜欢
oracle一次性说清楚,多种分隔符的一个字段拆分多行,再多行多列多种分隔符拆多行,最终处理超亿亿。。亿级别数据量
Componentspace2022, assertions, protocols, bindings, and configuration files
ncs成都新电面试经验
Greenplum6.x常用语句
【踩坑】nacos注册一直连接localhost:8848,no available server
数字三角形模型 AcWing 1027. 方格取数
平台化,强链补链的一个支点
阿里p8推荐,测试覆盖率工具—Jacoco,实用性极佳
opencv之图像分割
Markdown editor Use of MD plug-in
随机推荐
Selenium automation integration, eight years of testing experience, soft test engineer, an article to teach you
redis故障处理 “Can‘t save in background: fork: Cannot allocate memory“
Analysis of abnormal channel number information before and after AGC re signature service
Implement custom memory allocator
Greenplum 6.x monitoring software setup
[Yugong series] February 2022 U3D full stack class 006 unity toolbar
年薪50w阿里P8亲自下场,教你如何从测试进阶
Gson converts the entity class to JSON times declare multiple JSON fields named
Greenplum6.x监控软件搭建
Mock. JS usage details
数字三角形模型 AcWing 275. 传纸条
数据分片介绍
Newly found yii2 excel processing plug-in
LeetCode 736. LISP syntax parsing
Test pits - what test points should be paid attention to when adding fields to existing interfaces (or database tables)?
ncs成都新電面試經驗
Mock.js用法详解
Database storage - table partition
AVL balanced binary search tree
Greenplum 6.x common statements