当前位置:网站首页>Pat class B 1013
Pat class B 1013
2022-06-27 23:45:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
Realization
#include <iostream>
#include <cmath>
using namespace std;
bool isPrime(int num)
{
int i;
for (i = 2; i <= sqrt(num); i++)
{
if (num%i == 0)
return false;
}
return true;
}
int main(int argc, char* argv[])
{
int count=1,num=2;
int PM,PN,n,m,hang=1;
cin>>PN>>PM;
n=PN;m=PM;
while(count<=m)
{
if(isPrime(num))
{
//cout<<num<<" ";
if(count>=PN)
{
if(hang%10==0)
{
if(count!=PM)
cout<<num<<endl;
else
cout<<num;
}
else
{
if(count==m)
cout<<num;
else
cout<<num<<" ";
}
hang++;
}
count++;
}
//PN--;
num++;
}
//cout<<isPrime(4);
return 0;
}Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/133170.html Link to the original text :https://javaforall.cn
边栏推荐
- The choice and trade-off between vector recall and literal recall
- 实践torch.fx:基于Pytorch的模型优化量化神器
- [sword finger offer] 47 Maximum value of gifts
- 【剑指Offer】47. 礼物的最大价值
- 【Vim】使用教程,常用命令,高效使用Vim编辑器
- ICML 2022: UFRGS |作为最优策略转移基础的乐观线性支持和后继特征
- How to start ID from 1 after MySQL deletes a table
- 文献综述如何挑选文献进行阅读,比如我的检索结果有200多篇根本看不完,如何进行文献挑选呢?...
- vmware虚拟机桥接连通
- 撰写外文时怎样引用中文文献?
猜你喜欢

Vivado FFT IP的使用说明

如何设置企业微信群机器人定时发消息?

捷码赋能案例:湖南天辰产研实力迅速提升!实战玩转智慧楼宇/工地等项目

通过 MQTT 检测对象和传输图像

Feign implements path escape through custom annotations

Prediction of benign / malignant breast tumors (logistic regression classifier)

撰写外文时怎样引用中文文献?

C language character pointer and string initialization

The latest cloud development wechat balance charger special effect applet source code

EasyCVR平台路由日志功能的技术实现过程【附代码】
随机推荐
打造南沙“强芯”,南沙首届IC Nansha大会召开
pytorch实现kaggle猫狗识别
Halcon's region: features of multiple regions (6)
Started a natural language model bloom
良/恶性乳腺肿瘤预测(逻辑回归分类器)
Storage structure of graph
To build a "strong core" in Nansha, the first IC Nansha conference was held in Nansha
virtualbox扩展动态磁盘大小的坑
解决新版chrome跨域问题:cookie丢失以及samesite属性问题「建议收藏」
apipost脚本使用讲解一~全局变量
Teach you how to transplant tinyriscv to FPGA
Is it safe to open a stock account through the account opening QR code of CICC securities manager? Or is it safe to open an account in a securities company?
往前一步是优秀,退后一步是懵懂
The file or assembly 'cefsharp.core.runtime.dll' or one of its dependencies could not be loaded. Is not a valid Win32 Application. (exception from hresult:0x800700c1)
【PCL自学:PCLVisualizer】点云可视化工具PCLVisualizer
seata
C WinForm reads the resources picture
文献综述如何挑选文献进行阅读,比如我的检索结果有200多篇根本看不完,如何进行文献挑选呢?...
VMware virtual machine bridging connectivity
SQL中IS NOT NULL与!=NULL的区别