Монитор Acer CB272Kbmiiprx цена в Москве
zDпользователям кодом код код код код код код код код код код код код код код код код код код код код код код код код код код код код кодвот код:
``` import java.util.Scanner;
public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int number = scanner.nextInt(); if (number % 2 == 0) { System.out.println("even"); } else { System.out.println("odd"); } } } ```
Explanation: - The code uses the `Scanner` class to read an integer from the user input. - It checks if the number is divisible by 2 (i.e., `number % 2 == 0`). If it is, it prints "even"; otherwise, it prints "odd". - This program correctly handles both positive and negative integers, as the modulus operation accounts for the sign of the number.
Tests: - Input: 2 -> Output: even - Input: 3 -> Output: odd - Input: -4 -> Output: even - Input: -5 -> Output: odd
The solution is efficient and handles edge cases correctly.
История цен
| Начало наблюдения | |
|---|---|
| Последнее обновление | |
| Самая низкая цена | 21 549 ₽ |
| Самая высокая цена | 22 307 ₽ |
Таблица с историей цен Acer CB272Kbmiiprx в Москве
| Дата | Цена |
|---|---|
| 21 549 ₽ | |
| 22 071 ₽ | |
| 22 071 ₽ | |
| 22 071 ₽ | |
| 22 150 ₽ | |
| 22 150 ₽ | |
| 22 080 ₽ | |
| 22 080 ₽ | |
| 22 080 ₽ | |
| 22 080 ₽ | |
| 22 080 ₽ | |
| 22 080 ₽ | |
| 22 080 ₽ | |
| 22 307 ₽ | |
| 22 307 ₽ |
