codeforces 4A Watermelon(数学水题)
来源:互联网 发布:网页美工设计实训 编辑:程序博客网 时间:2024/05/18 15:27
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.
The first (and the only) input line contains integer number w (1 ≤ w ≤ 100) — the weight of the watermelon bought by the boys.
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.
8
YES
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).
不多说,太水了(水平有限,只能刷这么水的题了);直接上代码:
#include <iostream>#include <stdio.h>using namespace std;int main(){ int n; while(cin>>n) { if(n%2==0&&n!=2) cout<<"YES"<<endl; else cout<<"NO"<<endl; } return 0;}
- codeforces 4A Watermelon(数学水题)
- codeforces 4A Watermelon
- Codeforces 4A. Watermelon
- CodeForces 4A-Watermelon
- codeforces-4A-Watermelon
- Codeforces 4A Watermelon
- codeforces 4A watermelon
- Codeforces Beta Round #4 (Div. 2) / 4A Watermelon(数学)
- CodeForces 4 A.Watermelon(水~)
- CodeForces 4 A.Watermelon(水)
- Codeforces Round #4A. Watermelon
- Codeforces 4A-Watermelon(题意)
- Problem--4A--Codeforces--Watermelon
- CodeForces 4A Watermelon(太水了。。。。。)
- CodeForces 4A Watermelon(水题)
- codeforces Round4 A. Watermelon
- 【CodeForces】A. Watermelon
- CF 4A Watermelon(水??!!)
- Win8 + VS2013 + SQL Server 2014 下载地址
- 个地方和风格化发给街净哥和价格
- 刚学 RMQ 求大神指点
- 八皇后布局问题 -- 回溯法
- flash 中的部分概念
- codeforces 4A Watermelon(数学水题)
- 黑马程序员——三大特性
- 第十三周自由练习项目——acm
- OCP-1Z0-051 补充题库 第5题 主查询和子查询的注意事项
- 虚函数
- Mybatis动态sql详解
- 平滑曲线连接各点(贝塞尔曲线)
- 【记录】Accelerated C++:Practical Programming by Example第1章:使用字符串
- 每日算法之十八: Remove Nth Node From End of List