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;

}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值