283
|
1 #include <stdio.h>
|
|
2
|
|
3 int main(void)
|
|
4 {
|
|
5 int b;
|
|
6
|
|
7 for (b = 99; b >= 0; b--) {
|
|
8 switch (b) {
|
|
9 case 0:
|
|
10 printf("No more bottles of beer on the wall, no more bottles of beer.\n");
|
|
11 printf("Go to the store and buy some more, 99 bottles of beer on the wall.\n");
|
|
12 break;
|
|
13 case 1:
|
|
14 printf("1 bottle of beer on the wall, 1 bottle of beer.\n");
|
|
15 printf("Take one down and pass it around, no more bottles of beer on the wall\n");
|
|
16 break;
|
|
17 default:
|
|
18 printf("%d bottles of beer on the wall, %d bottles of beer.\n", b, b);
|
|
19 printf("Take one down and pass it around, %d %s of beer on the wall.\n"
|
|
20 ,b - 1
|
|
21 ,((b - 1) > 1)? "bottles" : "bottle");
|
|
22 break;
|
|
23 }
|
|
24 }
|
|
25 return 0;
|
|
26 } |