добавлен исходный код и ссылки
This commit is contained in:
parent
c83ed6cf42
commit
4be7b9c4ce
15 changed files with 438 additions and 1 deletions
16
01-знакомство-с-языком-d/src/chapter-1-1/app.d
Normal file
16
01-знакомство-с-языком-d/src/chapter-1-1/app.d
Normal file
|
@ -0,0 +1,16 @@
|
|||
import std.stdio;
|
||||
|
||||
void main()
|
||||
{
|
||||
// Значения, которые никогда не изменятся
|
||||
immutable inchesPerFoot = 12;
|
||||
immutable cmPerInch = 2.54;
|
||||
// Перебираем и пишем
|
||||
foreach (feet; 5 .. 7)
|
||||
{
|
||||
foreach (inches; 0 .. inchesPerFoot)
|
||||
{
|
||||
writeln(feet, "'", inches, "''\t", (feet * inchesPerFoot + inches) * cmPerInch);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue