604
社区成员
发帖
与我相关
我的任务
分享
int a = 10;
double b = 0.01;
int c = a/b;
void __fastcall TForm1::FormCreate(TObject *Sender)
{
int a = 10;
double b = 0.01;
double c = a/double(b);
int d = c ;
ShowMessage(c) ; //1000
ShowMessage(d) ;//1000
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int a = 10;
double b = 0.01;
int c = int((double)a/b);
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
double a = 10;
double b = 0.01;
double c = a/b;
ShowMessage(FloatToStr(c));//显示1000
}