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.
#include<iostream>
using namespace std;
int main() {
int a;
cin >> a;
if (a == 2)cout << "NO";//如果质量是整数2,分成两部分是1+1,都是单数
else if (a % 2 == 0) cout << "YES";
else cout << "NO";
return 0;
}
版权声明:本文为weixin_44012730原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。