請問計算機程式的一些問題 |
尚未結案
|
josh0621
一般會員 發表:3 回覆:0 積分:0 註冊:2006-10-11 發送簡訊給我 |
想請教各位大大,我的計算機程式卡在除法的部份,不知如何修改 可以麻煩各位大大幫我解答ㄇ?
procedure TForm1.Button11Click(Sender: TObject); begin if op1=0 then begin num1:=num1 button11.caption; label1.Caption:=num1; end else begin num2:=num2 button11.caption; label1.Caption:=num2; end end; procedure TForm1.Button13Click(Sender: TObject); begin op3:=1; if op1=0 then begin if num1<>' ' then begin op1:=1; a:=strtoint(num1); num1:=' '; op2:=op3; end end else begin if num2<>' ' then begin b:=strtoint(num2); num2:=' '; op1:=2; end else begin op2:=op3; end end; if op1=2 then begin if op2=3 then begin a:=a*b; label1.Caption:=inttostr(a); b:=0; op2:=op3; op1:=1; end; if op2=1 then begin a:=a b; label1.Caption:=inttostr(a); b:=0; op2:=op3; op1:=1; end; if op2=2 then begin a:=a-b; label1.Caption:=inttostr(a); b:=0; op2:=op3; op1:=1; end; if op2=4 then begin a:=a/b; 錯在這 錯誤訊息:incompatible types: 'integer' and 'extended' label1.Caption:=inttostr(a); b:=0; op2:=op3; op1:=1; end; end else begin op2:=op3; end; end;
------
張韋軒 |
saeba
一般會員 發表:0 回覆:2 積分:0 註冊:2006-10-11 發送簡訊給我 |
|
saeba
一般會員 發表:0 回覆:2 積分:0 註冊:2006-10-11 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |