关于最小偶数2的特判
作者:互联网
链接:https://ac.nowcoder.com/acm/problem/22014
来源:牛客网
空间限制:C/C++ 32768K,其他语言65536K
64bit IO Format: %lld
题目描述
群众想要吃瓜,于是给你一个瓜让你切,但是作为考验告诉你西瓜的重量,问你能否将这个西瓜分成两部分,每个部分都是偶数。
输入描述:
输入一行,包含一个整数weight,表示西瓜的重量1 <= weight <= 100
输出描述:
输出一行,见样例。示例1
输入
复制8
输出
复制YES, you can divide the watermelon into two even parts.示例2
输入
复制3
输出
复制NO, you can't divide the watermelon into two even parts.
1 #include<iostream> 2 using namespace std; 3 int main() 4 { 5 int w; 6 cin >> w; 7 (w%2!=0 || 2==w)? // 8 (cout<<"NO, you can't divide the watermelon into two even parts.") 9 :(cout<<"YES, you can divide the watermelon into two even parts."); 10 return 0; 11 }
标签:输出,西瓜,示例,int,特判,最小,偶数,复制,输入 来源: https://www.cnblogs.com/smile5/p/12010352.html