|  | 
 
| 
#include<stdio.h>
x
马上注册,结交更多好友,享用更多功能^_^您需要 登录 才可以下载或查看,没有账号?立即注册  int main()
 {
 int weight;
 scanf("%d",&weight);
 if(weight==2||weight%4==0)
 printf("YES, you can divide the watermelon into two even parts.");
 else
 printf("NO, you can't divide the watermelon into two even parts.");
 }
 
 
 
 
 #include<stdio.h>
 int main()
 {
 int weight;
 scanf("%d",&weight);
 if(weight%2==0&&weight!=2)
 printf("YES, you can divide the watermelon into two even parts.");
 else
 printf("NO, you can't divide the watermelon into two even parts.");
 }
 
 
 感觉这俩段差不多来着
 
复制代码if(weight==2||weight%4==0)
如果是 2 或 4的倍数 则打印 yes
 复制代码if(weight%2==0&&weight!=2)
如果是 2 的倍数且不等于 2 则打印yes
 
能看出区别了么?
 
第一个取值范围: 2 4 8 12 16 20 ... 
第二个取值范围: 4 6 8 10 12 14 ... | 
 |