当前位置:网站首页>Zzuli:1057 prime number determination
Zzuli:1057 prime number determination
2022-07-03 14:34:00 【Snake_____】
Title Description
Enter a positive integer n, Judge n Is it a prime , if n Prime number , Output ”Yes”, Otherwise output ”No”. Be careful :1 Not primes .
Input
Enter a positive integer n(n<=1000)
Output
If n Is the prime output "Yes", Otherwise output "No". Output takes up one line .
The sample input Copy
2
Sample output Copy
Yes
Tips
Be careful :1 Not primes .
Be careful :1 Not primes .
Be careful :1 Not primes .
#include <stdio.h>
int main()
{
int i,n,b = 0;
scanf("%d",&n);
if(n==1)
printf("No");
else
{
for(i=2;i<n;i++)
{
if(n%i==0)
{
b=1;
break;
}
else
continue;
}
if(b==0)
printf("Yes");
else
if (b==1)
printf("No");}
return 0;
}边栏推荐
- tonybot 人形机器人 红外遥控玩法 0630
- Code writing and playing method of tonybot humanoid robot at fixed distance
- 【北大青鸟昌平校区】互联网行业中,哪些岗位越老越吃香?
- 556. The next larger element III
- C language,%d% Difference between 2D%2d%02d
- Concat and concat_ Ws() differences and groups_ Use of concat() and repeat() functions
- Sendmail无法发送邮件及发送过慢解决
- How to query the baby category of tmall on Taobao
- ConstraintLayout 的使用
- tonybot 人形机器人 查看端口并对应端口 0701
猜你喜欢

adc128s022 ADC verilog设计实现

US stock listing of polar: how can the delivery of 55000 units support the valuation of more than 20billion US dollars

pyQt界面制作(登录+跳转页面)

Tonybot humanoid robot infrared remote control play 0630

Pyqt interface production (login + jump page)

修改数据库中的记录为什么报这个错

Tonybot Humanoïde Robot Infrared Remote play 0630

tonybot 人形机器人 查看端口并对应端口 0701

Frequently asked questions: PHP LDAP_ add(): Add: Undefined attribute type in

ShowMeBug入驻腾讯会议,开启专业级技术面试时代
随机推荐
Doris学习笔记之数据表的创建
Sub GHz wireless solution Z-Wave 800 Series zg23 SOC and zgm230s modules
Luogu p5018 [noip2018 popularization group] symmetric binary tree problem solution
如何查询淘宝天猫的宝贝类目
Find specified characters
7-24 reduction of the simplest fraction (rolling Division)
String substitution
MongoDB数据库入门的常用命令
超简单手机地图开发
Happy capital new dual currency fund nearly 4billion yuan completed its first account closing
Frequently asked questions: PHP LDAP_ add(): Add: Undefined attribute type in
关于敏捷的一些概念
7-9 one way in, two ways out (25 points)
556. 下一个更大元素 III
7-3 count the number of words in a line of text
Too many files with unapproved license
Luogu p5536 [xr-3] core city solution
Luogu p4047 [jsoi2010] tribal division solution
2021年区域赛ICPC沈阳站J-Luggage Lock(代码简洁)
【7.3】146. LRU caching mechanism