C :: Aufgabe #32 :: Lösung #3
3 Lösungen
#32
99 Bottles of Beer - Selbstständige Lösung
Anfänger - C
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.
#3
von kathleenw (3600 Punkte)
- 09.07.2020 um 10:21 Uhr
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int i;
for (i=99;i>0;i--) {
if (i==1)
printf("%d bottle of beer on the wall, %d bottle of beer.\nTake one down and pass it around, %d bottle of beer.\n\n",i,i,i);
else
printf("%d bottles of beer on the wall, %d bottles of beer.\nTake one down and pass it around, %d bottles of beer.\n\n",i,i,i);
}
return EXIT_SUCCESS;
}
Kommentare:
Für diese Lösung gibt es noch keinen Kommentar
Seite 1 von 0
1
