当前位置:网站首页>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;
}
边栏推荐
- Reviewer dis's whole research direction is not just reviewing my manuscript. What should I do?
- 【OpenCV 例程200篇】220.对图像进行马赛克处理
- 966 minimum path sum
- js中,字符串和数组互转(二)——数组转为字符串的方法
- [MySQL] basic use of cursor
- 1500万员工轻松管理,云原生数据库GaussDB让HR办公更高效
- El table table - get the row and column you click & the sort of El table and sort change, El table column and sort method & clear sort clearsort
- [200 opencv routines] 220 Mosaic the image
- Common English vocabulary that every programmer must master (recommended Collection)
- 面试官:Redis中有序集合的内部实现方式是什么?
猜你喜欢

3D face reconstruction: from basic knowledge to recognition / reconstruction methods!

SAP UI5 框架的 manifest.json

【mysql】游标的基本使用

for循环中break与continue的区别——break-完全结束循环 & continue-终止本次循环

Laravel笔记-自定义登录中新增登录5次失败锁账户功能(提高系统安全性)

请问sql group by 语句问题

ICML 2022 | flowformer: task generic linear complexity transformer
![[MySQL] trigger](/img/b5/6df17eb254bbdb0aba422d08f13046.png)
[MySQL] trigger

967- letter combination of telephone number

15 millions d'employés sont faciles à gérer et la base de données native du cloud gaussdb rend le Bureau des RH plus efficace
随机推荐
字符串的使用方法之startwith()-以XX开头、endsWith()-以XX结尾、trim()-删除两端空格
OSPF multi zone configuration
Yyds dry goods count re comb this of arrow function
【OpenCV 例程200篇】220.对图像进行马赛克处理
967- letter combination of telephone number
Web开发小妙招:巧用ThreadLocal规避层层传值
20220211 failure - maximum amount of data supported by mongodb
No Yum source to install SPuG monitoring
el-table表格——获取单击的是第几行和第几列 & 表格排序之el-table与sort-change、el-table-column与sort-method & 清除排序-clearSort
3D face reconstruction: from basic knowledge to recognition / reconstruction methods!
【论文解读】用于白内障分级/分类的机器学习技术
硬件开发笔记(十): 硬件开发基本流程,制作一个USB转RS232的模块(九):创建CH340G/MAX232封装库sop-16并关联原理图元器件
ICML 2022 | Flowformer: 任务通用的线性复杂度Transformer
全网最全的新型数据库、多维表格平台盘点 Notion、FlowUs、Airtable、SeaTable、维格表 Vika、飞书多维表格、黑帕云、织信 Informat、语雀
HMS Core 机器学习服务打造同传翻译新“声”态,AI让国际交流更顺畅
3D face reconstruction: from basic knowledge to recognition / reconstruction methods!
JS according to the Chinese Alphabet (province) or according to the English alphabet - Za sort &az sort
【深度学习】PyTorch 1.12发布,正式支持苹果M1芯片GPU加速,修复众多Bug
js 根据汉字首字母排序(省份排序) 或 根据英文首字母排序——za排序 & az排序
Mtcnn face detection