Перенос страниц

This commit is contained in:
Alexander Zhirov 2023-03-05 15:30:34 +03:00
parent 4d57446057
commit 4c954c9186
129 changed files with 14 additions and 15 deletions

View file

@ -0,0 +1,15 @@
import std.stdio;
void main()
{
auto array = [0, 2, 4, 6, 8, 10];
array = array[0 .. $ - 2];
// Су­же­ние спра­ва на два эле­мен­та
assert(array == [0, 2, 4, 6]);
array = array[1 .. $];
// Су­же­ние сле­ва на один эле­мент
assert(array == [2, 4, 6]);
array = array[1 .. $ - 1];
// Су­же­ние с обе­их сто­рон
assert(array == [4]);
}