当前位置:网站首页>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
边栏推荐
猜你喜欢

halcon之区域:多种区域(Region)特征(6)

【数字IC/FPGA】检测最后一个匹配序列的位置

EXCEL 打印设置公共表头

webService

未能加载文件或程序集“CefSharp.Core.Runtime.dll”或它的某一个依赖项。 不是有效的 Win32 应用程序。 (异常来自 HRESULT:0x800700C1)

Discuz taobaoke website template / Dean taobaoke shopping style commercial version template

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

Feign implements path escape through custom annotations

Working at home is more tiring than going to work at the company?
![[try to hack] kill evaluation](/img/93/e623e25dc4dec1f656227c7651577e.png)
[try to hack] kill evaluation
随机推荐
第 2 章 集成 MP
通过中金证券经理的开户二维码开股票账户安全吗?还是去证券公司开户安全?
One step forward is excellent, one step backward is ignorant
思源笔记订阅停止直接删云端数据嘛?
零基础自学SQL课程 | CASE函数
Usage of vivado vio IP
Online JSON to plaintext tool
系统学习+主动探索,是最舒适的入门学习方式!
Can you do these five steps of single cell data cleaning?
【AI应用】NVIDIA Tesla V100S-PCIE-32GB的详情参数
文献综述如何挑选文献进行阅读,比如我的检索结果有200多篇根本看不完,如何进行文献挑选呢?...
Practice torch FX: pytorch based model optimization quantization artifact
c语言字符指针、字符串初始化问题
往前一步是优秀,退后一步是懵懂
ICML 2022:ufrgs | optimistic linear support and subsequent features as the basis for optimal strategy transfer
上手了一个自然语言模型BLOOM
How to start ID from 1 after MySQL deletes a table
const关键字及其作用(用法),C语言const详解
golang使用mongo-driver操作——查(数组相关)
Detailed explanation of MATLAB axis coordinate axis related settings