Voting
Category
real language
Language C++
(hacking style)
Date: | 04/20/05 |
Author: | Tim Robinson |
URL: | n/a |
Comments: | 5 |
Info: | n/a |
Score: | (3.26 in 27 votes) |
// C++ version of 99 Bottles of beer // programmer: Tim Robinson timtroyr@ionet.net // Corrections by Johannes Tevessen #include <iostream> using namespace std; int main() { int bottles = 99; while ( bottles > 0 ) { cout << bottles << " bottle(s) of beer on the wall," << endl; cout << bottles << " bottle(s) of beer." << endl; cout << "Take one down, pass it around," << endl; cout << --bottles << " bottle(s) of beer on the wall." << endl; } return 0; }
Download Source | Write Comment
Alternative Versions
Version | Author | Date | Comments | Rate |
---|---|---|---|---|
extreme template metaprogramming | Richard Wolf | 04/20/05 | 5 | |
meta programming | Arion Lei | 04/20/05 | 2 | |
ob fuscated | Tapi (Paddy O'Brien) | 08/11/05 | 2 | |
object-oriented version | Tim Robinson | 04/20/05 | 2 | |
GUI version | Martyn Davies | 05/28/05 | 0 |
Download Source | Write Comment
Add Comment
Please provide a value for the fields Name,
Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.
Please use the form to submit new examples!
Comments
Zak said on 05/17/05 21:53:23
nice, may be shorter
ksdkjcjdas said on 01/10/06 11:28:23
Well, just add in the last part and you will recreate the entire song...
Mick said on 04/06/06 21:24:23
I like the never ending thing.
PhreakerD7 said on 04/08/06 20:44:32
Yeah. I saw the first one that was long as hell and was thinking "WHILE loop, anyone?"
freacker4life said on 04/29/06 10:16:24
Pretty Good. There's just one problem. After executing this program, it quits automatically. I think its better to add a "cin.get();" after the loop at least.