当前位置:网站首页>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;
}
边栏推荐
- 【7.3】146. LRU caching mechanism
- Jiuyi cloud black free encryption free version source code
- Puzzle (016.4) domino effect
- 7-23 currency conversion (using array conversion)
- etcd集群权限管理和账号密码使用
- How Facebook moves instagram from AWS to its own server
- Zzuli:1041 sum of sequence 2
- 必贝特医药冲刺科创板:年营收97万亏损1.37亿 拟募资20亿
- 7-3 rental (20 points)
- Convert string to decimal integer
猜你喜欢
NPM install is stuck with various strange errors of node NPY
Sword finger offer 28 Symmetric binary tree
Timecho of Tianmou technology completed an angel round financing of nearly 100 million yuan to create a native timing database of the industrial Internet of things
Frequently asked questions: PHP LDAP_ add(): Add: Undefined attribute type in
Comprehensive evaluation of good-looking, easy-to-use and powerful handwriting note taking software: notability, goodnotes, marginnote, handwriting, notes writers, collanote, collanote, prodrafts, not
修改数据库中的记录为什么报这个错
Leetcode (4) - - trouver la médiane de deux tableaux ordonnés positifs
Eight sorts
Happy capital new dual currency fund nearly 4billion yuan completed its first account closing
556. The next larger element III
随机推荐
Creation of data table of Doris' learning notes
7-9 one way in, two ways out (25 points)
Understand the application scenario and implementation mechanism of differential segment
必贝特医药冲刺科创板:年营收97万亏损1.37亿 拟募资20亿
MongoDB索引
Concat and concat_ Ws() differences and groups_ Use of concat() and repeat() functions
Puzzle (016.3) is inextricably linked
Zzuli:1045 numerical statistics
Luogu p5018 [noip2018 popularization group] symmetric binary tree problem solution
MongoDB数据库入门的常用命令
etcd集群权限管理和账号密码使用
Etcd cluster permission management and account password usage
adc128s022 ADC verilog设计实现
如何查询淘宝天猫的宝贝类目
The mail function of LNMP environment cannot send mail
Zhejiang University Edition "C language programming (4th Edition)" topic set reference ideas set
Solr series of full-text search engines - basic principles of full-text search
Preliminary summary of structure
基因家族特征分析 - 染色体定位分析
How Facebook moves instagram from AWS to its own server