Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Beers {
- public static void main(String[] args) {
- for (int i = 99; i > 0; i--) {
- if (i == 1) {
- System.out.printf("%d bottles of beer on the wall, %d bottles of beer.%nTake one down and pass it around, no more bottles of beer on the wall.%n", i, i);
- break;
- }
- System.out.printf("%d bottles of beer on the wall, %d bottles of beer.%nTake one down and pass it around, %d bottles of beer on the wall.%n", i, i, i-1);
- }
- System.out.printf("No more bottles of beer on the wall, no more bottles of beer.%nGo to the store and buy some more, 99 bottles of beer on the wall.%n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement