当前位置:网站首页>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;
}
边栏推荐
- C language,%d% Difference between 2D%2d%02d
- Sword finger offer 28 Symmetric binary tree
- SSH access control, blocking the IP when logging in repeatedly to prevent brute force cracking
- Mongodb index
- 关于敏捷的一些概念
- 556. 下一个更大元素 III
- Jiuyi cloud black free encryption free version source code
- Zzuli:1046 product of odd numbers
- Get permissions dynamically
- tonybot 人形机器人 红外遥控玩法 0630
猜你喜欢
Mysql多表查询 #子查询
Concat and concat_ Ws() differences and groups_ Use of concat() and repeat() functions
ShowMeBug入驻腾讯会议,开启专业级技术面试时代
Happy capital new dual currency fund nearly 4billion yuan completed its first account closing
Adc128s022 ADC Verilog design and Implementation
Comprehensive evaluation of good-looking, easy-to-use and powerful handwriting note taking software: notability, goodnotes, marginnote, handwriting, notes writers, collanote, collanote, prodrafts, not
Showmebug entered Tencent conference, opening the era of professional technical interview
dllexport和dllimport
Niuke: crossing the river
分布式事务(Seata) 四大模式详解
随机推荐
Comprehensive evaluation of good-looking, easy-to-use and powerful handwriting note taking software: notability, goodnotes, marginnote, handwriting, notes writers, collanote, collanote, prodrafts, not
pyQt界面制作(登录+跳转页面)
China PETG market forecast and Strategic Research Report (2022 Edition)
Jiuyi cloud black free encryption free version source code
Leetcode (4) -- find the median of two positively ordered arrays
DDK for XP
Selective sorting
Tonybot humanoid robot infrared remote control play 0630
Solr series of full-text search engines - basic principles of full-text search
Get permissions dynamically
retrofit
7-15 calculation of PI
Zhejiang University Edition "C language programming (4th Edition)" topic set reference ideas set
别再问自己适不适合做软件测试了
Time conversion ()
Sword finger offer 28 Symmetric binary tree
7-20 print 99 formula table (format output)
泰凌冲刺科创板:拟募资13亿 国家大基金与小米长江是股东
Use of constraintlayout
Luogu p4047 [jsoi2010] tribal division solution