Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. package com.company;
  2. public class Main {
  3.     public static void main(String[] args) {
  4.         int x = 3;
  5.         while (x > 0) {
  6.             String y = (x == 1 ? "бутылка" : "бутылки");
  7.  
  8.             System.out.println(x + " " + y + " пива на стене");
  9.             System.out.println(x + " " + y + " пива.");
  10.             System.out.println("Возьми одну.");
  11.             System.out.println("Пусти по кругу.");
  12.             System.out.println();
  13.  
  14.             x = x - 1;
  15.         }
  16.         System.out.println("нет бутылок пива на стене");
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement