#include<bits/stdc++.h>
using namespace std;
int main(){ int n; cin>>n; if(n==0){ cout<<"NO, you can't divide the watermelon into two even parts."; }else if(n==2)cout<<"NO, you can't divide the watermelon into two even parts.";else if(n%2==0)cout<<"YES, you can divide the watermelon into two even parts.";else cout<<"NO, you can't divide the watermelon into two even parts."; return 0; }//0和2要考虑进去
共 4 条回复
2是不能切成两个偶数的,大兄弟!!!
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; if(n==0){ cout<<"NO, you can't divide the watermelon into two even parts."; }else if(n==2)cout<<"NO, you can't divide the watermelon into two even parts.";else if(n%2==0)cout<<"YES, you can divide the watermelon into two even parts.";else cout<<"NO, you can't divide the watermelon into two even parts."; return 0; }//0和2要考虑进去
还是不对
偶数里面有一个非常特殊的偶数, 2 !