当前位置:网站首页>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
边栏推荐
- 强化学习-学习笔记4 | Actor-Critic
- Multi branch structure
- Concept and syntax of function
- 爬虫练习题(二)
- 5 years of experience, 27 days of Android programmer interview, 2022 programmer advanced classic
- 【FAQ】华为帐号服务报错 907135701的常见原因总结和解决方法
- What does software testing do? What are the requirements for learning?
- Millimeter wave radar human body sensor, intelligent perception of static presence, human presence detection application
- Reinforcement learning - learning notes 4 | actor critical
- Fuzor 2020软件安装包下载及安装教程
猜你喜欢
随机推荐
多分支结构
Xaas trap: all things serve (possible) is not what it really needs
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
That's awesome. It's enough to read this article
Debezium系列之:记录mariadb数据库删除多张临时表debezium解析到的消息以及解决方法
面试官:Redis中集合数据类型的内部实现方式是什么?
The binary string mode is displayed after the value with the field type of longtext in MySQL is exported
word如何转换成pdf?word转pdf简单的方法分享!
Is it safe for Guohai Securities to open an account online?
【obs】QString的UTF-8中文转换到blog打印 UTF-8 char*
third-party dynamic library (libcudnn.so) that Paddle depends on is not configured correctl
MMO項目學習一:預熱
MySQL中字段类型为longtext的值导出后显示二进制串方式
Is it safe for Anxin securities to open an account online?
[AI framework basic technology] automatic derivation mechanism (autograd)
Using repositoryprovider to simplify the value passing of parent-child components
【无标题】
MMO project learning 1: preheating
再忙不能忘安全
测试的核心价值到底是什么?






