当前位置:网站首页>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
边栏推荐
- How about testing outsourcing companies?
- Is it safe for Anxin securities to open an account online?
- Postman core function analysis - parameterization and test report
- Concept and syntax of function
- Add data to excel small and medium-sized cases through poi
- 通过POI追加数据到excel中小案例
- 如何在2022年更明智地应用智能合约?
- 【obs】libobs-winrt :CreateDispatcherQueueController
- 【合集- 行业解决方案】如何搭建高性能的数据加速与数据编排平台
- Fundamentals of shell programming (Chapter 9: loop)
猜你喜欢

Zhongang Mining: analysis of the current market supply situation of the global fluorite industry in 2022

众昂矿业:2022年全球萤石行业市场供给现状分析

Force buckle 1200 Minimum absolute difference

强化学习-学习笔记4 | Actor-Critic

力扣 729. 我的日程安排表 I

How to realize the Online timer and offline timer in the game

Bitcoinwin (BCW)受邀参加Hanoi Traders Fair 2022

Notion 类生产力工具如何选择?Notion 、FlowUs 、Wolai 对比评测

The relationship between temperature measurement and imaging accuracy of ifd-x micro infrared imager (module)

如何实现游戏中的在线计时器和离线计时器
随机推荐
MySql中的longtext字段的返回问题及解决
C application interface development foundation - form control (5) - grouping control
The city chain technology Digital Innovation Strategy Summit was successfully held
中国银河证券开户安全吗 证券开户
How to convert word into PDF? Word to PDF simple way to share!
okcc呼叫中心有什么作用
PHP uses ueditor to upload pictures and add watermarks
什么是面上项目
What is the function of okcc call center
毫米波雷达人体感应器,智能感知静止存在,人体存在检测应用
Common - Hero Minesweeper
[Collection - industry solutions] how to build a high-performance data acceleration and data editing platform
C#应用程序界面开发基础——窗体控制(6)——菜单栏、工具栏和状态栏控件
Django使用mysqlclient服务连接并写入数据库的操作过程
Is it safe for China Galaxy Securities to open an account? Securities account opening
HiEngine:可媲美本地的云原生内存数据库引擎
Postman核心功能解析-参数化和测试报告
Millimeter wave radar human body sensor, intelligent perception of static presence, human presence detection application
C#应用程序界面开发基础——窗体控制(5)——分组类控件
Debezium系列之:解析默认值字符集