Глава 2 закончена
This commit is contained in:
parent
42b2af19c0
commit
09dc3df444
18 changed files with 261 additions and 1 deletions
20
02-основные-типы-данных-выражения/src/chapter-2-3-11/app.d
Normal file
20
02-основные-типы-данных-выражения/src/chapter-2-3-11/app.d
Normal file
|
@ -0,0 +1,20 @@
|
|||
import std.stdio;
|
||||
|
||||
void main()
|
||||
{
|
||||
double[string] table = [
|
||||
"one": 1.0,
|
||||
"two": 2.0
|
||||
];
|
||||
writeln(table);
|
||||
auto p = "three" in table;
|
||||
if (p)
|
||||
{
|
||||
++*p;
|
||||
}
|
||||
else
|
||||
{
|
||||
table["three"] = 3.0;
|
||||
}
|
||||
writeln(table);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue