当前位置:网站首页>ACM getting started Day1
ACM getting started Day1
2022-07-05 19:42:00 【ANYOUZHEN】
acm website :【 Deep base 7. example 2】 Prime sieve - Luogu Luogu net
Title Description :
The source code is as follows :
#include<stdio.h>
int main()
{
int n, i, j;
int sushu(int n);// Define a function for judging prime numbers , If it is a prime number, return m The value of is 1
int a[1000];
printf("please enter a number:");
scanf_s("%d", &n);
for (i = 0; i < n; i++)
scanf_s("%d", &a[i]);
for (i = 0; i < n; i++)
{
if (sushu(a[i]) == 1)
{
printf("%3d", a[i]);
}// Output prime number
}
}
int sushu(int j)// Prime function
{
int i; int m;
for (i = 2; i < j; i++)
{
if (j % i == 0)
{
m = 0;
}
else
{
m = 1;
}
return m;
}
}
The successful running :
acm Finish the first day of entry
边栏推荐
- 5 years of experience, 27 days of Android programmer interview, 2022 programmer advanced classic
- 关于 Notion-Like 工具的反思和畅想
- openh264解码数据流向分析
- 安信证券在网上开户安全吗?
- vagrant2.2.6支持virtualbox6.1版本
- PHP uses ueditor to upload pictures and add watermarks
- How to apply smart contracts more wisely in 2022?
- HAC cluster modifying administrator user password
- 大厂面试必备技能,2022Android不死我不倒
- HAC集群修改管理员用户密码
猜你喜欢
安卓面试宝典,2022Android面试笔试总结
2022 the latest big company Android interview real problem analysis, Android development will be able to technology
Necessary skills for interview in large factories, 2022android will not die, I will not fall
The problem of returning the longtext field in MySQL and its solution
MMO項目學習一:預熱
Force buckle 729 My schedule I
Inventory of the most complete low code / no code platforms in the whole network: Jiandao cloud, partner cloud, Mingdao cloud, Qingliu, xurong cloud, Jijian cloud, treelab, nailing · Yida, Tencent clo
Add data to excel small and medium-sized cases through poi
MySql中的longtext字段的返回问题及解决
Bitcoinwin (BCW) was invited to attend Hanoi traders fair 2022
随机推荐
Wildcard selector
MySQL中字段类型为longtext的值导出后显示二进制串方式
集合
[untitled]
Debezium系列之:解析默认值字符集
[AI framework basic technology] automatic derivation mechanism (autograd)
third-party dynamic library (libcudnn.so) that Paddle depends on is not configured correctl
Bitcoinwin (BCW)受邀参加Hanoi Traders Fair 2022
从零实现深度学习框架——LSTM从理论到实战【实战】
The city chain technology Digital Innovation Strategy Summit was successfully held
Microwave radar induction module technology, real-time intelligent detection of human existence, static micro motion and static perception
Recommended collection, my Tencent Android interview experience sharing
国海证券在网上开户安全吗?
How to choose the notion productivity tools? Comparison and evaluation of notion, flowus and WOLAI
S7-200SMART利用V90 MODBUS通信控制库控制V90伺服的具体方法和步骤
如何安全快速地从 Centos迁移到openEuler
Android interview, Android audio and video development
PG basics -- Logical Structure Management (user and permission management)
UWB超宽带定位技术,实时厘米级高精度定位应用,超宽带传输技术
Concept and syntax of function