4 глава

This commit is contained in:
Alexander Zhirov 2023-02-05 19:45:16 +03:00
parent e0caa7caab
commit ec805e7f08
15 changed files with 1584 additions and 1 deletions

View file

@ -0,0 +1,23 @@
import std.stdio;
void print(double[string] map)
{
foreach (i, e; map)
{
writefln("array['%s'] = %s;", i, e);
}
}
void main()
{
float[] arr = [ 1.0, 2.5, 4.0 ];
foreach (ref float elem; arr)
{
elem *= 2; // Без про­блем
}
writeln(arr);
print(["Луна": 1.283, "Солнце": 499.307, "Проксима Центавра": 133_814_298.759]);
}