当前位置:网站首页>Smart people's game improvement: Chapter 3 Lesson 3 example: the secret of prime
Smart people's game improvement: Chapter 3 Lesson 3 example: the secret of prime
2022-07-24 04:14:00 【Shining Sirius】
#include <iostream>
#include <cstdio>
using namespace std;
int n,i,j,k;
int t(int a)
{
for (j=2;j*j<=a;j++)
if (a%j==0)
return 0;
return 1;
}
int main()
{
cin >>n;
for (i=2;i<=n;i++)
{
if (t(i))
{
cout <<i <<" ";
k++;
if (k%5==0)
cout <<endl;
}
}
return 0;
}边栏推荐
- From bio to realizing the function of simple multi person chat room -- IO model
- Redis sentinel mode, master node check script
- iPhone手机绑定163邮箱解决方案
- 6-13 vulnerability exploitation -smtp brute force cracking
- Four characteristics of nb-iot
- ACM warm-up Exercise 4 in 2022 summer vacation (summary)
- Vscode configuration user code snippet
- [JS] save the string as a file to the local (.Txt,.Json,.Md...)
- How safe is Volvo XC90? Come and have a look
- 清单的要快速熟悉并掌昇腾AI处理器支持
猜你喜欢

Codeforces Round #808 (Div. 2) A - D

The second anniversary of opengauss' open source, cracking the pain point of database ecology

硬件知识3--IIC协议

svg图片颜色的修改 没有花里胡哨

iPhone手机绑定163邮箱解决方案

(5) Digital electricity formula simplification method

Worthington hydroxysteroid dehydrogenase technical description and determination scheme

"Wei Lai Cup" 2022 Niuke summer multi school training camp 1 (summary of some topics)

一次 svchost.exe 进程占用大量网络带宽的排查

Analyze the real-time development method of Bank of London
随机推荐
May be a little useful cold knowledge
Jinglianwen technology provides 3D point cloud image annotation service
。其中调用时传入t指与Devi遍的,根本问t2,
ARP Spoofing protection of network security
清单的要快速熟悉并掌昇腾AI处理器支持
LAN SDN hard core technology insider 21 Kang long regrets -- Specifications and restrictions (middle)
MLP - Multilayer Perceptron
发送数据1010_1发人员通过 字节的
Introduction to JVM class loading process
[C language] program environment and preprocessing operation
Solution to the problem of "out of sight, out of mind, out of order" in the training competition
Combinatorial number (number of prime factors of factorials, calculation of combinatorial number)
[translation] chaos mesh moved to CNCF incubator
1.7.1 正误问题(中缀表达式)
SqlServer 备份还原
短视频本地生活版块,有哪些新的机会存在?
flask框架中页面跳转与重定向
002_ Kubernetes installation configuration
Parallel technology of Oracle
Worthington hydroxysteroid dehydrogenase technical description and determination scheme