September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
17
Task/FizzBuzz/D/fizzbuzz-2.d
Normal file
17
Task/FizzBuzz/D/fizzbuzz-2.d
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import std;
|
||||
|
||||
void main()
|
||||
{
|
||||
auto fizzbuzz(in uint i)
|
||||
{
|
||||
string r;
|
||||
if (i % 3 == 0) r ~= "fizz";
|
||||
if (i % 5 == 0) r ~= "buzz";
|
||||
if (r.length == 0) r ~= i.to!string;
|
||||
return r;
|
||||
}
|
||||
|
||||
enum r = 1.iota(101).map!fizzbuzz;
|
||||
|
||||
r.each!writeln;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue