任意一條直線切等分算座標? |
答題得分者是:diablo09105
|
a58705077
一般會員 發表:2 回覆:1 積分:0 註冊:2008-11-13 發送簡訊給我 |
|
diablo09105
一般會員 發表:25 回覆:45 積分:24 註冊:2011-05-31 發送簡訊給我 |
我的程式沒有使用小數點
如果需要請自行修改喔~~~ 請參考↓↓↓ [code cpp] //--------------------------------------------------------------------------- #include #pragma hdrstop #include "Unit1.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 * Form1; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent * Owner): TForm(Owner){} //--------------------------------------------------------------------------- void __fastcall TForm1::FormMouseDown(TObject * Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { if (Button == mbLeft) { Canvas->MoveTo(X, Y); Canvas->LineTo(X, Y); edt1->Text = X; edt2->Text = Y; } } //--------------------------------------------------------------------------- void __fastcall TForm1::FormMouseUp(TObject * Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { int abc, def; if (Button == mbLeft) { Canvas->LineTo(X, Y); edt3->Text = X; edt4->Text = Y; abc = ((edt3->Text) - (edt1->Text)) / 10; def = ((edt4->Text) - (edt2->Text)) / 10; edt5->Text = abc StrToInt(edt1->Text); edt7->Text = abc * 2 StrToInt(edt1->Text); edt9->Text = abc * 3 StrToInt(edt1->Text); edt11->Text = abc * 4 StrToInt(edt1->Text); edt13->Text = abc * 5 StrToInt(edt1->Text); edt15->Text = abc * 6 StrToInt(edt1->Text); edt17->Text = abc * 7 StrToInt(edt1->Text); edt19->Text = abc * 8 StrToInt(edt1->Text); edt21->Text = abc * 9 StrToInt(edt1->Text); edt23->Text = abc * 10 StrToInt(edt1->Text); edt6->Text = def StrToInt(edt2->Text); edt8->Text = def * 2 StrToInt(edt2->Text); edt10->Text = def * 3 StrToInt(edt2->Text); edt12->Text = def * 4 StrToInt(edt2->Text); edt14->Text = def * 5 StrToInt(edt2->Text); edt16->Text = def * 6 StrToInt(edt2->Text); edt18->Text = def * 7 StrToInt(edt2->Text); edt20->Text = def * 8 StrToInt(edt2->Text); edt22->Text = def * 9 StrToInt(edt2->Text); edt24->Text = def * 10 StrToInt(edt2->Text); } } //---------------------------------------------------------------------------[/code]
------
燒毛崴 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |