multidimensional array:
DESCRIPTION
Multidimensional Array:. อนันต์ ผลเพิ่ม Anan Phonphoem [email protected]. Score[1]. 90. Score[2]. 75. Score[3]. 40. Score[4]. 67. Score[5]. 55. Score[6]. 30. One dimensional Array. Type ScoreArr = array [1..6] of integer ; var score: ScoreArr;. Election Score. - PowerPoint PPT PresentationTRANSCRIPT
One dimensional Array
Type ScoreArr = array[1..6] of integer;
var score: ScoreArr;90
75
40
67
55
30
Score[1]
Score[2]
Score[3]
Score[4]
Score[5]
Score[6]
Election Score
Type ScoreArr = array[1..6] of integer;
var Score: ScoreArr;
907540675530
Score
123456
Candidate #
Election: 3 districts
907540675530
Type ScoreArr = array[1..6] of integer;var scoreD1, scoreD2, scoreD3: ScoreArr;
105
60721244
34789
22663
ScoreD1 ScoreD2 ScoreD3
123456
Candidate #
2-dimensional array
907540675530
10560721244
3478922663
ScoreD1 ScoreD2 ScoreD3
907540675530
10560721244
3478922663
123456
Score
2-dimensional array
907540675530
10560721244
3478922663
123456
ScoreCandidate # District
1 2 3
Score[candidate, district]Score[1,1] =Score[4,2] = Score[5,3] =
2-dimensional array
907540675530
10560721244
3478922663
123456
Score1 2 3
Type Score2Arr = array[1..6,1..3] of integer;
var Score: Score2Arr;
Accessing Array elements Score[1,1] = 10
For I := 1 to 6 doReadln(Score[I,1]);
For candidate := 1 to 6 doFor district := 1 to 3 do
Readln(Score[candidate, district]);
For district := 1 to 3 doWriteln(Score[3,district]);
Practice… Write a program to find the winner
of the election in each district Write a program to find the winner
of the election Write an O-X game (Tic-Tac-Toe)
3-dimensional array
XX--
-XX-
-X--
1234
1 2 3---X
-XXX
-X-X
1 2 3
8 PM Midnight
Movie Title: สุ�ริ�โยไท
Seat[round, row, col]Seat[Evening, 3, 1] = Available;Seat[Midnight, 2, 4] = Taken;