Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Most loops start with i=0, so i=3 will be harder to compress, increasing script size and slowing down and git pushes.
think about all cases: 2 odds, 2 even and 1 odd& 1even, you will find all cases lead to same result: even number.
This comment is hidden because it contains spoiler information about the solution
I think it should begin with i=3
长姿势了
How can you be so clever!
How can you so clever? How many code that you have writen?
Mine too!!! For pretty much everything!
The service is always time out!!! Making me crazy!
The big problem is that I don't understand the meaning of this problem!
Thank you!Your answer is not my want,But I have understand it.
I'm not English myself, so I understand the language problems, but I am not sure what you are asking, so please ask me again if I am answering the wrong question.
The kata wants the result rounded (look at the last sentence of the description), so I need to use
Math.round()
. Javadoc is found here: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#round-double-Note that if I pass in a double, it returns a long. That's why I need to add the
(int)
cast on the last line.English is not my mother tongue.Maybe sometimes my expression is not clear.In this condition ,I don't anderstand why it use 4 but not 3?
Casting it to an
int
just throws away the decimal part, whileMath.round()
will round it to the nearest integer:Does that answer your question?
I don't understand why it use Math.round but not (int) to get the answer?
Loading more items...