Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class HomeWork2 {
- public static void main(String[] args) {
- Scanner consol = new Scanner(System.in);
- System.out.println("Введите озраст призывника: ");
- int numConsol = consol.nextInt();
- System.out.println("Возраст призывника:" + numConsol);
- if (numConsol > 28) {
- System.out.println("Поздно тебе в армию.");
- } else if (numConsol < 18) {
- System.out.println("Рано тебе в армию...");
- } else {
- System.out.println("Готов служить Родине!");
- }
- if (numConsol > 150) {
- System.out.println("Уже очень поздно, послужишь в другом мире!");
- }
- if (numConsol < 0) {
- System.out.println("Ты еще не родился.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement