Глава 2 закончена
This commit is contained in:
parent
42b2af19c0
commit
09dc3df444
18 changed files with 261 additions and 1 deletions
21
02-основные-типы-данных-выражения/src/chapter-2-2-6/app.d
Normal file
21
02-основные-типы-данных-выражения/src/chapter-2-2-6/app.d
Normal file
|
@ -0,0 +1,21 @@
|
|||
import std.stdio;
|
||||
|
||||
void main()
|
||||
{
|
||||
auto somePrimes = [ 2u, 3, 5, 7, 11, 13 ];
|
||||
writeln(somePrimes);
|
||||
auto someDoubles = [ 1.5, 3, 4.5 ];
|
||||
writeln(someDoubles);
|
||||
|
||||
auto constants = [ 2.71, 3.14, 6.023e22 ];
|
||||
writeln(constants);
|
||||
constants[0] = 2.21953167;
|
||||
writeln(constants);
|
||||
auto salutations = [ "привет", "здравствуйте", "здорово" ];
|
||||
writeln(salutations);
|
||||
salutations[2] = "Да здравствует Цезарь";
|
||||
writeln(salutations);
|
||||
|
||||
auto famousNamedConstants = [ "пи" : 3.14, "e" : 2.71, "константа дивана" : 2.22 ];
|
||||
writeln(famousNamedConstants);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue