Systemnahe Programmierung in C: Initialisierung mehrdimensionaler Felder |
1/* unnoetige Redundanz */
2
3int magic1[5][5] =
4 { {17, 24, 1, 8, 15},
5 {23, 5, 7, 14, 16},
6 { 4, 6, 13, 20, 22},
7 {10, 12, 19, 21, 3},
8 {11, 18, 25, 2, 9}
9 };
10
11/* o.k.*/
12
13int magic2[][5] =
14 { {17, 24, 1, 8, 15},
15 {23, 5, 7, 14, 16},
16 { 4, 6, 13, 20, 22},
17 {10, 12, 19, 21, 3},
18 {11, 18, 25, 2, 9}
19 };
20
21
22/* unsystematisch */
23
24int magic3[5][5] =
25 { 17, 24, 1, 8, 15,
26 23, 5, 7, 14, 16,
27 4, 6, 13, 20, 22,
28 10, 12, 19, 21, 3,
29 11, 18, 25, 2, 9
30 };
|
Letzte Änderung: 11.01.2007 | © Prof. Dr. Uwe Schmidt |