当前位置:网站首页>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
边栏推荐
- Debezium系列之:postgresql从偏移量加载正确的最后一次提交 LSN
- 线程池参数及合理设置
- webuploader文件上传 拖拽上传 进度监听 类型控制 上传结果监听控件
- Worthy of being a boss, byte Daniel spent eight months on another masterpiece
- The city chain technology Digital Innovation Strategy Summit was successfully held
- [hard core dry goods] which company is better in data analysis? Choose pandas or SQL
- Gstreamer中的task
- UWB ultra wideband positioning technology, real-time centimeter level high-precision positioning application, ultra wideband transmission technology
- Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL
- redis集群模拟消息队列
猜你喜欢
UWB ultra wideband positioning technology, real-time centimeter level high-precision positioning application, ultra wideband transmission technology
The problem of returning the longtext field in MySQL and its solution
力扣 1200. 最小绝对差
C#应用程序界面开发基础——窗体控制(5)——分组类控件
通过POI追加数据到excel中小案例
Millimeter wave radar human body sensor, intelligent perception of static presence, human presence detection application
MySql中的longtext字段的返回问题及解决
关于 Notion-Like 工具的反思和畅想
不愧是大佬,字节大牛耗时八个月又一力作
Force buckle 729 My schedule I
随机推荐
Is it safe for China Galaxy Securities to open an account? Securities account opening
What is the function of okcc call center
2022 the latest big company Android interview real problem analysis, Android development will be able to technology
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
Successful entry into Baidu, 35K monthly salary, 2022 Android development interview answer
C#应用程序界面开发基础——窗体控制(6)——菜单栏、工具栏和状态栏控件
国海证券在网上开户安全吗?
关于 Notion-Like 工具的反思和畅想
[AI framework basic technology] automatic derivation mechanism (autograd)
安卓面试宝典,2022Android面试笔试总结
Fuzor 2020軟件安裝包下載及安裝教程
Shell编程基础(第8篇:分支语句-case in)
如何实现游戏中的在线计时器和离线计时器
【obs】libobs-winrt :CreateDispatcherQueueController
成功入职百度月薪35K,2022Android开发面试解答
Debezium系列之:记录mariadb数据库删除多张临时表debezium解析到的消息以及解决方法
The city chain technology Digital Innovation Strategy Summit was successfully held
HiEngine:可媲美本地的云原生内存数据库引擎
【obs】libobs-winrt :CreateDispatcherQueueController