- UID
- 19078
- 帖子
- 144
- 主題
- 9
- 精華
- 0
- 積分
- 23
- 楓幣
- 505
- 威望
- 21
- 存款
- 197
- 贊助金額
- 0
- 推廣
- 1
- GP
- 7
- 閱讀權限
- 10
- 性別
- 保密
- 在線時間
- 48 小時
- 註冊時間
- 2012-12-23
- 最後登入
- 2023-1-24
|
10楓幣
void __fastcall TForm1::Button3Click(TObject *Sender)
{
int rep = StrToInt(Edit4->Text);
int step = StrToInt(Edit5->Text);
Chart1->RemoveAllSeries();
Chart1->Title->Text->Clear();
Chart1->Title->Text->Add("Sorting Alg");
Chart1->BottomAxis->Title->Caption = "Data";
Chart1->LeftAxis->Title->Caption = "CPU Time *10";
data_num[0] = StrToInt(Edit1->Text);
for ( int i = 1 ; i < rep ; i ++ )
data_num[i] = data_num[0] + i*step ;
for ( int i = 0 ; i < rep ; i ++ )
{
Memo1 -> Lines -> Add("||Repeat = " + IntToStr(i+1)+"||");
Generation->Click();
Memo2 -> Lines -> Add("||Repeat = " + IntToStr(i+1)+"||");
Selection->Click();
Memo3 -> Lines -> Add("||Repeat = " + IntToStr(i+1)+"||");
Bubble->Click();
Memo4 -> Lines -> Add("||Repeat = " + IntToStr(i+1)+"||");
Binary->Click();
//Edit1->Text=IntToStr(n+step);
repeat ++;
}
for (int i=0;i<2;i++)
{
TLineSeries *Series=new TLineSeries(Chart1);
Series->ParentChart=Chart1;
Chart1->AddSeries(Series);
}
for (int i=0; i<rep; i++)
{
Chart1->Series[0]->Title = "Selection Sort";
Chart1->Series[1]->Title = "Bubble Sort";
Chart1->Series[0]->Add( SelSortTime[i] , data_num[i] , clBlue );
Chart1->Series[1]->Add( BubSortTime[i] , data_num[i] , clRed );
}
}
控制所有按鍵 再次點擊 值全部變為0 有誰能幫我解答嗎 感恩
|
|