This site requires JavaScript, please enable it in your browser!
Greenfoot back
pandu4431
pandu4431 wrote ...

2015/5/3

please help me fast solve this question

pandu4431 pandu4431

2015/5/3

#
i need your help master, please help me make the algorithm of this question this not a greenfoot, this just netbeans/eclipse program please help me please
lordhershey lordhershey

2015/5/3

#
Cannot see the image...
pandu4431 pandu4431

2015/5/3

#
Pete and Billy are great fans of even numbers, that's why they want to divide the watermelon  in such a way that each of the two parts weighs even number of kilos, at the same time it is  not obligatory that the parts are equal. The boys are extremely tired and want to start their  meal as soon as possible, that's why you should help them and find out, if they can divide the  watermelon in the way they want. For sure, each of them should get a part of positive weight.    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.      ___________________________________ |Sample Input | Sample Output | |8  | YES  | |______________|__________________|   Note  For example, the boys can divide the watermelon into two parts of 2 and 6 kilos respectively  (another variant — two parts of 4 and 4 kilos). 
Super_Hippo Super_Hippo

2015/5/3

#
if (input>3 && input%2==0)
{
    System.out.println("YES");
}
else
{
    System.out.println("NO");
}
Like this? Every positive even number except 2 is dividable into two parts of even numbers. (2 isn't possible, because 1 and 1 is the only solution, assuming 0 isn't a positive weight.)
You need to login to post a reply.