-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBeerSong.java
More file actions
24 lines (20 loc) · 761 Bytes
/
BeerSong.java
File metadata and controls
24 lines (20 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
public class BeerSong
{
public static void main(String args[])
{
int nCountDown = 100;
while (nCountDown > 0)
{
System.out.println(nCountDown + " bottle" + (nCountDown > 1 ? "s" : "") + " of beer on the wall");
System.out.println(nCountDown + " bottle" + (nCountDown > 1 ? "s" : "") + " of beer");
System.out.println("Take one down.");
System.out.println("Pass it around.");
nCountDown = nCountDown - 1;
if (nCountDown > 0)
{
System.out.println(nCountDown + " bottle" + (nCountDown > 1 ? "s" : "") + " of beer on the wall");
}
}
System.out.println("No more bottles of beer on the wall");
}
}