- Watermelon
- CodeForces - 4A
Qingyu 有一个简单的问题想让你解决.
输入一个数, 如果它是 2, 或者它是奇数, 输出 NO, 否则输出 YES.
很简单吧, 因此你应该很快解决.
输入
输入只有一行, 包含一个整数 $n$
输出
输出只有一行, 包含 YES 或者 NO
示例
输入:
2
输出:
NO
输入:
233
输出:
NO
输入:
20050702
输出:
YES
sol: 前面都挺容易的
- #include <bits/stdc++.h>
- using namespace std;
- typedef int ll;
- inline ll read()
- {
- ll s=0;
- bool f=0;
- char ch=' ';
- while(!isdigit(ch))
- {
- f|=(ch=='-'); ch=getchar();
- }
- while(isdigit(ch))
- {
- s=(s<<3)+(s<<1)+(ch^48); ch=getchar();
- }
- return (f)?(-s):(s);
- }
- #define R(x) x=read()
- inline void write(ll x)
- {
- if(x<0)
- {
- putchar('-'); x=-x;
- }
- if(x<10)
- {
- putchar(x+'0'); return;
- }
- write(x/10);
- putchar((x%10)+'0');
- return;
- }
- #define W(x) write(x),putchar(' ')
- #define Wl(x) write(x),putchar('\n')
- int main()
- {
- int x=read();
- ((x==2)||(x&1))?puts("NO"):puts("YES");
- return 0;
- }
- View Code
来源: http://www.bubuko.com/infodetail-2995367.html