хинт: четное число делится на два без остатка. нечетное - с остатком.
можно поделить на два и посмотреть что получится.
а можно воспользоваться этим:
Цитата:
% (modulo)
Availability
Flash Player 4.
Usage
expression1 % expression2
Parameters
None.
Returns
A number.
Description
Operator (arithmetic); calculates the remainder of expression1 divided by expression2.
Example
The following numeric example uses the modulo (%) operator:
trace(12%5); // traces 2
The trace returns 2, rather than 12/5 or 2.4, because the modulo (%) operator returns only the remainder.
|
интенсивнее думаем самостоятельно :)