AtCoder BeginnerContest 114 A-753

Time Limit: 2 sec / Memory Limit: 1024 MB

Score : 100100 points

Problem Statement

Shichi-Go-San (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.

七五三(字面意思是“七五三”)是在某个国家庆祝七、五、三岁儿童成长的传统活动。

Takahashi is now XX years old. Will his growth be celebrated in Shichi-Go-San this time?

Constraints

  • 1X≤91≤X≤9
  • XX is an integer.

Input

Input is given from Standard Input in the following format:

XX

Output

If Takahashi's growth will be celebrated, print YES; if it will not, print NO.

Sample Input 1 

5

Sample Output 1 

YES

The growth of a five-year-old child will be celebrated.

Sample Input 2 

6

Sample Output 2 

NO

 

分析:这是道非常简单的题目,只要判断一下输入是否为3、5、7即可,用If进行条件判断,若为3、5、7其中任意一个,就输出YES否则输出NO。

代码:

#include<iostream>

#include<cstdio>

#include<algorithm>

using namespace std;

int main(){

int n;

cin>>n;

if(n == 5 || n == 3 || n == 7)

cout<<"YES"<<endl;

else

cout<<"NO"<<endl;

return 0;

}

 

全部评论

相关推荐

你背过凌晨4点的八股文么:简历挂了的话会是流程终止,像我一样
点赞 评论 收藏
分享
05-12 17:28
已编辑
门头沟学院 硬件开发
ldf李鑫:不说公司名祝你以后天天遇到这样的公司
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务