当前位置:网站首页>Absolute primes (C language)
Absolute primes (C language)
2022-07-06 21:16:00 【Bamboo pride】
problem : Write a program , Enter two positive integers , Output absolute primes between two positive integers ;
Operation diagram :

Source code :
#include <stdio.h>
int main()
{
int a,b;
int i,x,y,z;
int h=0,v;
scanf("%d %d",&a,&b);
for(i=a;i<=b;i++)
{
int j;
for(j=2;j<i;j++)
{
if(i%j==0)
{
break;
}
}
if(j==i)
{
i=j;
x=i%10;
y=(i%100)/10;
z=i/100;
if(z==0)
{
h=x*10+y;
}
if(z>0)
{
h=x*100+y*10+z;
}
h=h;
for(v=2;v<h;v++)
{
if(h%v==0)
{
break;
}
}
if(v==h)
{
printf("%d\n",i);
}
}
}
return 0;
}
边栏推荐
- Three schemes of SVM to realize multi classification
- Le langage r visualise les relations entre plus de deux variables de classification (catégories), crée des plots Mosaiques en utilisant la fonction Mosaic dans le paquet VCD, et visualise les relation
- 防火墙基础之外网服务器区部署和双机热备
- Word bag model and TF-IDF
- 967- letter combination of telephone number
- Comprehensive evaluation and recommendation of the most comprehensive knowledge base management tools in the whole network: flowus, baklib, jiandaoyun, ones wiki, pingcode, seed, mebox, Yifang cloud,
- 2022 fields Award Announced! The first Korean Xu Long'er was on the list, and four post-80s women won the prize. Ukrainian female mathematicians became the only two women to win the prize in history
- [200 opencv routines] 220 Mosaic the image
- [in depth learning] pytorch 1.12 was released, officially supporting Apple M1 chip GPU acceleration and repairing many bugs
- 快过年了,心也懒了
猜你喜欢

Aiko ai Frontier promotion (7.6)

OAI 5g nr+usrp b210 installation and construction

Deployment of external server area and dual machine hot standby of firewall Foundation

966 minimum path sum

Common English vocabulary that every programmer must master (recommended Collection)

3D人脸重建:从基础知识到识别/重建方法!

3D人脸重建:从基础知识到识别/重建方法!

PHP saves session data to MySQL database

Study notes of grain Mall - phase I: Project Introduction

Introduction to the use of SAP Fiori application index tool and SAP Fiori tools
随机推荐
What is the problem with the SQL group by statement
Nodejs教程之Expressjs一篇文章快速入门
[200 opencv routines] 220 Mosaic the image
c#使用oracle存储过程获取结果集实例
Laravel笔记-自定义登录中新增登录5次失败锁账户功能(提高系统安全性)
Is it profitable to host an Olympic Games?
document. Usage of write () - write text - modify style and position control
967- letter combination of telephone number
Math symbols in lists
SAP UI5 框架的 manifest.json
HMS Core 机器学习服务打造同传翻译新“声”态,AI让国际交流更顺畅
数据湖(八):Iceberg数据存储格式
039. (2.8) thoughts in the ward
PG基础篇--逻辑结构管理(事务)
js之遍历数组、字符串
This year, Jianzhi Tencent
【mysql】触发器
The most comprehensive new database in the whole network, multidimensional table platform inventory note, flowus, airtable, seatable, Vig table Vika, flying Book Multidimensional table, heipayun, Zhix
PHP saves session data to MySQL database
Opencv learning example code 3.2.3 image binarization