全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:928
推到 Plurk!
推到 Facebook!

請各位大大指教一下,程式的問題

尚未結案
bear07
一般會員


發表:1
回覆:0
積分:0
註冊:2006-10-17

發送簡訊給我
#1 引用回覆 回覆 發表時間:2006-10-17 15:15:00 IP:59.104.xxx.xxx 未訂閱
最近剛上Delphi,可是老師啥都沒教,就跟我們講觀念而已,就叫我們寫程式,都要自學...,所以有些問題,請大大們幫幫忙了 謝謝
這是一個計算機的問題,要寫註釋,不太懂,請幫幫忙告知一下 謝謝
數字鍵的程式碼
num1:=num1 button7.Caption;
label1.Caption:=num1;
的程式碼
begin
if op1=0 then
begin
op1:=1;
a:=strtoint(num1);
num1:=' ';
end
else
begin
b:=strtoint(num1);
num1:=' ';
op2:=1;
end;
if op2>0 then
begin
cal();
label1.Caption:=inttostr(a);
end;
end;
-的程式碼
begin
if op1=0 then
begin
op1:=2;
a:=strtoint(num1);
num1:=' ';
end
else
begin
b:=strtoint(num1);
num1:=' ';
op2:=2;
end;
if op2>0 then
begin
cal();
label1.Caption:=inttostr(a);
end;
end;
x的程式碼
begin
if op1=0 then
begin
op1:=3;
a:=strtoint(num1);
num1:=' ';
end
else
begin
b:=strtoint(num1);
num1:=' ';
op2:=3;
end;
if op2>0 then
begin
cal();
label1.Caption:=inttostr(a);
end;
end;
=的程式碼
begin
if op1=0 then
label1.Caption:='error'
else
begin
b:=strtoint(num1);
op2:=5;
cal();
end;
label1.Caption:=inttostr(a);
op1:=0;
op2:=0;
num1:=' ';
a:=0;
b:=0;
end;
清除的程式碼
begin
op1:= 0;
op2:= 0;
num1:=' ';
a:=0;
label1.Caption:='0';
end;
procedure cal();
begin
if op2>0 then
begin
if op1=1 then
begin
a:=a b;
op1:=op2;
op2:=0;
b:=0;
end
else if op1=2 then
begin
a:=a-b;
op1:=op2;
op2:=0;
b:=0;
end
else if op1=3 then
begin
a:=a*b;
op1:=op2;
op2:=0;
b:=0;
end;
end;
end;
/ 的程式碼要怎麼寫呢? 還有每個部份是什麼意思呢? 還有要自學 要 買那本書看比較好呢? 請各位大大指點一下 謝謝

herbert2
尊榮會員


發表:58
回覆:640
積分:894
註冊:2004-04-16

發送簡訊給我
#2 引用回覆 回覆 發表時間:2006-10-26 00:08:05 IP:211.72.xxx.xxx 未訂閱
老師要您寫作業, 且只是要寫註釋, 就是要您看書去瞭解語法, 怎麼要人代您寫作業呢?

系統時間:2024-05-17 14:37:29
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!