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

#include

#include

using namespace std;

int main(){

int n;

cin>>n;

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

cout<<"YES"<

 

你可能感兴趣的:(入门,Atcoder题解)