当前位置:网站首页>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;
}
边栏推荐
- Swagger UI教程 API 文档神器
- Simple continuous viewing PTA
- [200 opencv routines] 220 Mosaic the image
- What is the difference between procedural SQL and C language in defining variables
- What is the problem with the SQL group by statement
- 全网最全的知识库管理工具综合评测和推荐:FlowUs、Baklib、简道云、ONES Wiki 、PingCode、Seed、MeBox、亿方云、智米云、搜阅云、天翎
- How to implement common frameworks
- 通过数字电视通过宽带网络取代互联网电视机顶盒应用
- 【OpenCV 例程200篇】220.对图像进行马赛克处理
- Select data Column subset in table R [duplicate] - select subset of columns in data table R [duplicate]
猜你喜欢

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

Redis insert data garbled solution

Manifest of SAP ui5 framework json

The difference between break and continue in the for loop -- break completely end the loop & continue terminate this loop

面试官:Redis中有序集合的内部实现方式是什么?

对话阿里巴巴副总裁贾扬清:追求大模型,并不是一件坏事

Opencv learning example code 3.2.3 image binarization

ICML 2022 | Flowformer: 任务通用的线性复杂度Transformer

20220211 failure - maximum amount of data supported by mongodb

KDD 2022 | 通过知识增强的提示学习实现统一的对话式推荐
随机推荐
【深度学习】PyTorch 1.12发布,正式支持苹果M1芯片GPU加速,修复众多Bug
Nodejs tutorial let's create your first expressjs application with typescript
Ravendb starts -- document metadata
Chris LATTNER, the father of llvm: why should we rebuild AI infrastructure software
Yyds dry inventory run kubeedge official example_ Counter demo counter
[interpretation of the paper] machine learning technology for Cataract Classification / classification
Aike AI frontier promotion (7.6)
Pat 1078 hashing (25 points) ⼆ times ⽅ exploration method
Is it profitable to host an Olympic Games?
@Detailed differences among getmapping, @postmapping and @requestmapping, with actual combat code (all)
No Yum source to install SPuG monitoring
[MySQL] basic use of cursor
基于深度学习的参考帧生成
What is the difference between procedural SQL and C language in defining variables
Simple continuous viewing PTA
Study notes of grain Mall - phase I: Project Introduction
Nodejs教程之让我们用 typescript 创建你的第一个 expressjs 应用程序
Redis insert data garbled solution
What are RDB and AOF
过程化sql在定义变量上与c语言中的变量定义有什么区别