Java :: Aufgabe #43 :: Lösung #2
6 Lösungen

#43
99 Bottles of Beer - Selbstständige Lösung
Anfänger - Java
von pocki
- 11.01.2013 um 14:07 Uhr
Programmiere eine eigenständige Lösung zur gängigen Programmier-Übung bzw. Lied 99 Bottles of Beer
Ausgabe:
Ausgabe:
Konsolenausgabe:
99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 99 bottles of beer on the wall.
98 bottles of beer on the wall, 98 bottles of beer.
... usw.
#2

von bequiet (220 Punkte)
- 27.06.2013 um 13:25 Uhr

public class bottles { public static void main(String[] args) { int n=99; do { if(n==0) { System.out.println("No more bottles of beer on the wall, no more bottles of beer. Go to the store and buy some more, Ninety-nine bottles of beer on the wall."); } else{ System.out.println(n +"bottles of beer on the wall, " + n + "bottles of beer." + "Take one down and pass it around, "+ n + "bottles of beer on the wall."); } n--; }while(n>=0); } }
Kommentare:
Für diese Lösung gibt es noch keinen Kommentar
Seite 1 von 0
1