procedure TForm1.Button1Click(Sender: TObject);
var
a:integer;
b:integer;
j:integer;
begin
a:=20;
b:=40;
j:=60;
label1.Caption :=InttoStr(a*b);{这样的话就可以通过}
//但是如果我这样写就一直报错label1.caption:InttoStr(a*b/j);
end;
是什么原因?

解决方案 »

  1.   

    我机子上没有delphi,在bcb里边试,没有问题的
    int a,b,j;
    a=20;
    b=40;
    j=60;
    Label1->Caption =IntToStr(a*b/j);你的那个写法
    //但是如果我这样写就一直报错label1.caption:InttoStr(a*b/j);label1.caption := InttoStr(a*b/j);是不是少了个=
      

  2.   

    //label1.caption := InttoStr(a*b/j);是不是少了个=倒..=号加进去也是错的.
    我在问的时候是临时写的.代码在家里.不知道是什么原因..哎.急死了..
      

  3.   

    [错误] Unit1.pas(37): There is no overloaded version of 'IntToStr' that can be called with these arguments
    这个是错误的提示..
      

  4.   

    / 除法符号是用于浮点数运算的,
    整型除法是 div ,即:
    Label1.Caption := IntToStr(a * b div j);