example 2

This commit is contained in:
Alexander Zhirov 2021-11-08 17:35:53 +03:00
parent 1fccd9bcc0
commit 9d57f84918
3 changed files with 40 additions and 0 deletions

15
src/example_2/.gitignore vendored Normal file
View File

@ -0,0 +1,15 @@
.dub
docs.json
__dummy.html
docs/
/example_2
example_2.so
example_2.dylib
example_2.dll
example_2.a
example_2.lib
example_2-test-*
*.exe
*.o
*.obj
*.lst

10
src/example_2/dub.json Normal file
View File

@ -0,0 +1,10 @@
{
"authors": [
"alexander"
],
"copyright": "Copyright © 2021, alexander",
"description": "Числа и выражения",
"license": "proprietary",
"name": "example_2",
"targetPath": "bin"
}

View File

@ -0,0 +1,15 @@
import std.stdio;
void main()
{
immutable byte inchesPerFoot = 12;
immutable cmPerInch = 2.54;
foreach (feet; 5 .. 7)
{
foreach (inches; 0 .. inchesPerFoot)
{
writefln("%d'%d''\t%f'", feet, inches, (feet * inchesPerFoot + inches) * cmPerInch);
}
}
}