Language D
Date: | 04/20/05 |
Author: | Philipp Winterberg |
URL: | http://www.winterbergs.de/ |
Comments: | 7 |
Info: | http://www.digitalmars.com/d/index.html |
Score: | (2.14 in 42 votes) |
// D version of 99 Bottles of beer (Bottles.d) // (http://www.digitalmars.com/d/index.html). // Philipp Winterberg, http://www.winterbergs.de int main() { for (int b = 99; b > 0; b--) { printf("%d bottle(s) of beer on the wall,\n", b); printf("%d bottle(s) of beer.\n", b); printf("Take one down, pass it around,\n"); printf("%d bottle(s) of beer on the wall.\n\n", (b-1)); } return 0; }
Download Source | Write Comment
Alternative Versions
Version | Author | Date | Comments | Rate |
---|---|---|---|---|
1 | Stewart Gordon | 05/31/05 | 4 | |
D feuture's galore | Fredrik Olsson | 10/09/05 | 2 | |
Template metaprogramming | Don Clugston | 07/11/06 | 1 | |
Fiber "Ring" | Bryan Knowles | 11/17/10 | 0 | |
Div Operator Edition | badmadevil | 02/29/08 | 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 don't post large portions of code here! Use the form to submit new examples or updates instead!
Comments
Paul Smirnov said on 06/28/05 09:06:36
Any D language specifics here? I didn't catch difference from C/C++.
Yakov Smirnoff said on 07/13/05 22:31:11
Does anyone actually use this language?
Ian Osgood said on 07/14/05 17:19:01
D is like C++ with many warts removed and lots of built-in libraries and modules. There are better examples at the Great Computer Language Shootout:
http://shootout.alioth.debian.org/great/
Hasan said on 07/28/05 07:47:37
Just go to the website, the main part of the site is the reference pages.
Bau de jogos said on 11/24/06 13:50:39
another wrong code :(
Mitu said on 09/29/09 15:03:33
Needs to be updated:
1. writef, not printf
2. import std.stdio; missing.
barrym said on 03/29/10 05:11:16
More lazy-ass "bottle(s)" code. C'mon Phil, give us a conditional
expression or two. Geez Louise..........