D,
pasted
on Oct 14:
|
import std.stdio: writef, writefln;
struct Point { int x, y; }
Point[2] arr1 = [{0,0}, {0,1}];
Point[3][2] arr2 = [
[{0,0}, {0,1}, {0,2}],
[{1,0}, {1,1}, {1,2}]
];
void main() {
foreach (i, point; arr1)
writefln("Point(%d) = {%d, %d}", i, arr1[i].x, arr1[i].y);
foreach(points; arr2) {
foreach(point; points)
writef("Point(%d, %d)\t", point.x, point.y);
writefln();
}
}
|
Output:
|
Point(0) = {0, 0}
Point(1) = {0, 1}
Point(0, 0) Point(0, 1) Point(0, 2)
Point(1, 0) Point(1, 1) Point(1, 2)
|
|