Language D
Date: | 05/31/05 |
Author: | Stewart Gordon |
URL: | http://www.stewartsplace.org.uk/ |
Comments: | 4 |
Info: | http://www.digitalmars.com/d/ |
Score: | (3.84 in 186 votes) |
import std.stdio; import std.string; void main() { int bottles = 99; char[] text = "99 bottles"; while (bottles != 0) { writefln(text, " of beer on the wall,"); writefln(text, " of beer."); writefln("Take one down, pass it around,"); if (--bottles == 1) { text = "1 bottle"; } else { text = format("%d bottles", bottles); } writefln(text, " of beer on the wall.\n"); } }
Download Source | Write Comment
Alternative Versions
Version | Author | Date | Comments | Rate |
---|---|---|---|---|
Template metaprogramming | Don Clugston | 07/11/06 | 1 | |
D feuture's galore | Fredrik Olsson | 10/09/05 | 2 | |
Fiber "Ring" | Bryan Knowles | 11/17/10 | 0 | |
Div Operator Edition | badmadevil | 02/29/08 | 0 | |
5 | Philipp Winterberg | 04/20/05 | 7 |
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 don't post large portions of code here! Use the form to submit new examples or updates instead!
Comments
gneek said on 10/05/08 00:45:57
This looks really nice!
Sylver said on 01/30/09 07:09:35
Nice, but you are missing the last line:
"No more bottles of beer on the wall, no more bottles of beer.
Go to the store and buy some more, 99 bottles of beer on the wall."
Demian said on 04/28/10 22:29:06
Wow, I love this one, very creative.
Chi Hair Straighteners said on 09/25/10 02:47:47
Cheap Chi Flat Irons, Chi Hair Straighteners sale at Farouk outlet, 100% Authentic & Brand New, All over world free shipping.
Chi Hair Straighteners
Chi Hair Straightener
Chi Flat Irons
Chi Flat Iron
cheap gucci shoes