美文网首页
acm第一次周测1.1

acm第一次周测1.1

作者: 尚恩_3295 | 来源:发表于2018-12-12 16:05 被阅读0次

One hot summer day Pete and his friend Billy decided to buy a watermelon. They chose the biggest and the ripest one, in their opinion. After that the watermelon was weighed, and the scales showed w kilos. They rushed home, dying of thirst, and decided to divide the berry, however they faced a hard problem.

Pete and Billy are great fans of even numbers, that's why they want to divide the watermelon in such a way that each of the two parts weighs even number of kilos, at the same time it is not obligatory that the parts are equal. The boys are extremely tired and want to start their meal as soon as possible, that's why you should help them and find out, if they can divide the watermelon in the way they want. For sure, each of them should get a part of positive weight.

Input
The first (and the only) input line contains integer number w (1 ≤ w ≤ 100) — the weight of the watermelon bought by the boys.

Output
Print YES, if the boys can divide the watermelon into two parts, each of them weighing even number of kilos; and NO in the opposite case.

Examples
Input
8
Output
YES
Note
For example, the boys can divide the watermelon into two parts of 2 and 6 kilos respectively (another variant — two parts of 4 and 4 kilos).

问题链接:https://vjudge.net/contest/274223#problem/A
问题简述:皮特和比利分一个西瓜 要求分成两个偶数

问题分析:
1.分成两个偶数
2.西瓜总重有要求

程序说明:
程序如下:

#include<iostream>
using namespace std;
int main()
{
    int n;
    cin >> n;
    if (n <= 100 && n >= 4)
    {
        if (n % 2 == 0)
            cout << "YES";
        else cout << "NO";
    }
    else cout << "NO";
    system("pause");return 0;
}

相关文章

  • acm第一次周测1.1

    One hot summer day Pete and his friend Billy decided to b...

  • acm第一次周测1.4

    给定三条边,请你判断一下能不能组成一个三角形。Input输入数据第一行包含一个数M,接下有M行,每行一个实例,包含...

  • acm1.1

    定义两个字符串,用一个作为输入字符串,使用一个for语句计算长度,if语句判断出元音字母,使其变为0,再次使用if...

  • 四种方式实现HttpServer并测试负载能力

    1.ServerSocket实现httpServer 1.1 阻塞式 代码: 压测结果: 1.2 多线程 压测结...

  • 从这里开始

    ACM国际大学生程序设计竞赛 什么是ACM-ICPC? ACM-ICPC全称“ACM International ...

  • ACM周赛2.1

    A - Problem A CodeForces - 1A Theatre Square in the capit...

  • 翻转实验第三周

    周测成绩令人欣慰,超越了兄弟班级,按同学们的话说是“这是第一次,以前没有过”。也有同学说周测不可信,有偶然性,我跟...

  • 周测试卷分析

    和乐中心小学贾艳艳随笔 本次周测是期中考试之后进行的第一次周测,出题内容是数学课本的前六单元的内容 ,...

  • 第一次周测

    周四晚上收到学校短信,告知家长学生的周测成绩。立刻感受到中学生的压力,从现在开始就要接受周测月考中考等排名...

  • 星耀小学三年二班彭诗涵《亲子共成长》日记

    今日周周测!

网友评论

      本文标题:acm第一次周测1.1

      本文链接:https://www.haomeiwen.com/subject/eqkphqtx.html