Kurso de Raku / Esencoj / Pli pri tipoj / Asociaj datentipoj / Nestitaj haketmapoj

Kvizo — Multnivelaj haketmapoj

Por la donita datuma strukturo:

my %statistics =
    1900 => {
        Jan => 500,
        Feb => 550,
    },
    2000 => {
        Jan => 1230,
        Feb => 1245,
    };

Elektu la liniojn kiuj provizas ĝustan aliron al la datuma ero por februaro de 1900.

1say %statistics<1900><Feb>;
1say %statistics{1900}<Feb>;Ĉi tio estas ĝusta, ĉar 1900 povas esti implicite konvertita al ĉeno.
0say %statistics{1900}{Feb};Malĝusta, ĉar Feb devas esti ĉeno.
1say %statistics{'1900'}{'Feb'};

Kursa navigado

Nestitaj haketmapoj   |   Interpolante haketmapojn