struct Line int int value Line next struct Matrix int Line value Matri

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
struct Line
{ int j;
int value;
Line* next;
} ;
struct Matrix
{ int i;
Line* value;
Matrix* next;
} ;
void __fastcall TForm1::BitBtn5Click(TObject *Sender)
{
AnsiString s1;
Line head, *pointer;
Matrix head2, *pointer2;
int i,j;
pointer=&head;
pointer2=&head2;
for (i=0;i<1000;i++)
for (j=0;j<1000;j++)
{ if (StringGrid1->Cells[i][j]!="")
{ pointer->next= new Line;
pointer=pointer->next;
pointer->value= StrToInt(StringGrid1->Cells[i][j]);
pointer->j=j;
pointer2->next= new Matrix;
pointer2=pointer2->next;
pointer2->value=pointer;
//ShowMessage(IntToStr(pointer2->value->j));
pointer2->i=i;
pointer->next=NULL;
pointer2->next=NULL;
}
}
while (pointer2!=NULL)
{
s1= IntToStr(pointer2->value->j)+",";
pointer2=pointer2->next;
}
ShowMessage(s1);
}