import std.random;
import std.stdio;

void main()
{
    // От 1 до 127 эле­мен­тов
    auto array = new double[uniform(1, 128)];

    foreach (i; 0 .. array.length)
    {
        array[i] = uniform(0.0, 1.0);
    }

    writeln(array);

    foreach (ref element; array)
    {
        element = uniform(0.0, 1.0);
    }

    writeln(array);

    auto copy = array.dup;
    assert(array !is copy);
    assert(array == copy);
}
