编译此程序时输出返回无效

时间:2015-05-26 09:55:44

标签: java

我在java教程书上找到了这个例子。

60 bottles of beer
Take one down.
Pass it around.
59 bottles of beer on the wall
59 bottles of beer on the wall
59 bottles of beer
Take one down.
Pass it around.
58 bottles of beer on the wall
58 bottles of beer on the wall
58 bottles of beer
Take one down.
Pass it around.
57 bottles of beer on the wall
57 bottles of beer on the wall
57 bottles of beer
Take one down.
Pass it around.
56 bottles of beer on the wall
56 bottles of beer on the wall
56 bottles of beer
Take one down.
Pass it around.
55 bottles of beer on the wall
55 bottles of beer on the wall
55 bottles of beer
Take one down.
Pass it around.
54 bottles of beer on the wall
54 bottles of beer on the wall
54 bottles of beer
Take one down.
Pass it around.
53 bottles of beer on the wall
53 bottles of beer on the wall
53 bottles of beer
Take one down.
Pass it around.
52 bottles of beer on the wall
52 bottles of beer on the wall
52 bottles of beer
Take one down.
Pass it around.
51 bottles of beer on the wall
51 bottles of beer on the wall
51 bottles of beer
Take one down.
Pass it around.
50 bottles of beer on the wall
50 bottles of beer on the wall
50 bottles of beer
Take one down.
Pass it around.
49 bottles of beer on the wall
49 bottles of beer on the wall
49 bottles of beer
Take one down.
Pass it around.
48 bottles of beer on the wall
48 bottles of beer on the wall
48 bottles of beer
Take one down.
Pass it around.
47 bottles of beer on the wall
47 bottles of beer on the wall
47 bottles of beer
Take one down.
Pass it around.
46 bottles of beer on the wall
46 bottles of beer on the wall
46 bottles of beer
Take one down.
Pass it around.
45 bottles of beer on the wall
45 bottles of beer on the wall
45 bottles of beer
Take one down.
Pass it around.
44 bottles of beer on the wall
44 bottles of beer on the wall
44 bottles of beer
Take one down.
Pass it around.
43 bottles of beer on the wall
43 bottles of beer on the wall
43 bottles of beer
Take one down.
Pass it around.
42 bottles of beer on the wall
42 bottles of beer on the wall
42 bottles of beer
Take one down.
Pass it around.
41 bottles of beer on the wall
41 bottles of beer on the wall
41 bottles of beer
Take one down.
Pass it around.
40 bottles of beer on the wall
40 bottles of beer on the wall
40 bottles of beer
Take one down.
Pass it around.
39 bottles of beer on the wall
39 bottles of beer on the wall
39 bottles of beer
Take one down.
Pass it around.
38 bottles of beer on the wall
38 bottles of beer on the wall
38 bottles of beer
Take one down.
Pass it around.
37 bottles of beer on the wall
37 bottles of beer on the wall
37 bottles of beer
Take one down.
Pass it around.
36 bottles of beer on the wall
36 bottles of beer on the wall
36 bottles of beer
Take one down.
Pass it around.
35 bottles of beer on the wall
35 bottles of beer on the wall
35 bottles of beer
Take one down.
Pass it around.
34 bottles of beer on the wall
34 bottles of beer on the wall
34 bottles of beer
Take one down.
Pass it around.
33 bottles of beer on the wall
33 bottles of beer on the wall
33 bottles of beer
Take one down.
Pass it around.
32 bottles of beer on the wall
32 bottles of beer on the wall
32 bottles of beer
Take one down.
Pass it around.
31 bottles of beer on the wall
31 bottles of beer on the wall
31 bottles of beer
Take one down.
Pass it around.
30 bottles of beer on the wall
30 bottles of beer on the wall
30 bottles of beer
Take one down.
Pass it around.
29 bottles of beer on the wall
29 bottles of beer on the wall
29 bottles of beer
Take one down.
Pass it around.
28 bottles of beer on the wall
28 bottles of beer on the wall
28 bottles of beer
Take one down.
Pass it around.
27 bottles of beer on the wall
27 bottles of beer on the wall
27 bottles of beer
Take one down.
Pass it around.
26 bottles of beer on the wall
26 bottles of beer on the wall
26 bottles of beer
Take one down.
Pass it around.
25 bottles of beer on the wall
25 bottles of beer on the wall
25 bottles of beer
Take one down.
Pass it around.
24 bottles of beer on the wall
24 bottles of beer on the wall
24 bottles of beer
Take one down.
Pass it around.
23 bottles of beer on the wall
23 bottles of beer on the wall
23 bottles of beer
Take one down.
Pass it around.
22 bottles of beer on the wall
22 bottles of beer on the wall
22 bottles of beer
Take one down.
Pass it around.
21 bottles of beer on the wall
21 bottles of beer on the wall
21 bottles of beer
Take one down.
Pass it around.
20 bottles of beer on the wall
20 bottles of beer on the wall
20 bottles of beer
Take one down.
Pass it around.
19 bottles of beer on the wall
19 bottles of beer on the wall
19 bottles of beer
Take one down.
Pass it around.
18 bottles of beer on the wall
18 bottles of beer on the wall
18 bottles of beer
Take one down.
Pass it around.
17 bottles of beer on the wall
17 bottles of beer on the wall
17 bottles of beer
Take one down.
Pass it around.
16 bottles of beer on the wall
16 bottles of beer on the wall
16 bottles of beer
Take one down.
Pass it around.
15 bottles of beer on the wall
15 bottles of beer on the wall
15 bottles of beer
Take one down.
Pass it around.
14 bottles of beer on the wall
14 bottles of beer on the wall
14 bottles of beer
Take one down.
Pass it around.
13 bottles of beer on the wall
13 bottles of beer on the wall
13 bottles of beer
Take one down.
Pass it around.
12 bottles of beer on the wall
12 bottles of beer on the wall
12 bottles of beer
Take one down.
Pass it around.
11 bottles of beer on the wall
11 bottles of beer on the wall
11 bottles of beer
Take one down.
Pass it around.
10 bottles of beer on the wall
10 bottles of beer on the wall
10 bottles of beer
Take one down.
Pass it around.
9 bottles of beer on the wall
9 bottles of beer on the wall
9 bottles of beer
Take one down.
Pass it around.
8 bottles of beer on the wall
8 bottles of beer on the wall
8 bottles of beer
Take one down.
Pass it around.
7 bottles of beer on the wall
7 bottles of beer on the wall
7 bottles of beer
Take one down.
Pass it around.
6 bottles of beer on the wall
6 bottles of beer on the wall
6 bottles of beer
Take one down.
Pass it around.
5 bottles of beer on the wall
5 bottles of beer on the wall
5 bottles of beer
Take one down.
Pass it around.
4 bottles of beer on the wall
4 bottles of beer on the wall
4 bottles of beer
Take one down.
Pass it around.
3 bottles of beer on the wall
3 bottles of beer on the wall
3 bottles of beer
Take one down.
Pass it around.
2 bottles of beer on the wall
2 bottles of beer on the wall
2 bottles of beer
Take one down.
Pass it around.
1 bottles of beer on the wall
1 bottle of beer on the wall
1 bottle of beer
Take one down.
Pass it around.
No more bottles of beer on the wall
Press any key to continue . . .

我对输出感到困惑。

99 bottles of beer

据我所知,代码输出应该以

开头
int beerNum = 99;

因为60 bottles of beer

任何人都可以解释为什么我用

开始超越输出
Name|Age|Job

提前致谢。 如果有人向我解释,我会非常满意的。

1 个答案:

答案 0 :(得分:0)

附件是输出。它确实以99 bottles of beerenter image description here

开头