void
CJSQDlg::OnBtnequal()
{
if(
!m_equal
)
{
double
x
=
atof(
m_preStr
);
double
y
=
atof(
m_postStr
);
switch(
m_Fuhao
)
{
case
1:
x
=
x
+
y;
break;
case
2:
x
=
x
-
y;
break;
case
3:
x
=
x
*
y;
break;
case
4:
x
=
x
/
y;
break;
case
5:
x
=
(int)x
%
(int)y;
break;
}
CString
LSstr;
LSstr.Format(
"%g",
x
);//將x轉化成字符串,保存在LSstr中
SetDlgItemText(
IDC_EDIT1,
LSstr
);//顯示最後結果