用c语言编写的计算器源代码
作品:科学计算器
作者:欧宗龙
编写环境:vc++
语言:c
#include ""
#include <>
#include <(A_Op)
{
SetDlgItemText(hwnd,IDC_EDIT,NULL);
}
GetDlgItemText(hwnd,IDC_EDIT,str,sizeof(str));
strcat(str,"2");
SetDlgItemText(hwnd,IDC_EDIT,str);
RNum[1]=atof(str);
A_Op=FALSE;
}
break;
case IDC_BUTTONN3://数字3
{
if(A_Op)
{
SetDlgItemText(hwnd,IDC_EDIT,NULL);
}
GetDlgItemText(hwnd,IDC_EDIT,str,sizeof(str));
strcat(str,"3");
SetDlgItemText(hwnd,IDC_EDIT,str);
RNum[1]=atof(str);
A_Op=FALSE;
}
break;
case IDC_BUTTONN4://数字4
{
if(A_Op)
{
SetDlgItemText(hwnd,IDC_EDIT,NULL);
}
GetDlgItemText(hwnd,IDC_EDIT,str,sizeof(str));
strcat(str,"4");
SetDlgItemText(hwnd,IDC_EDIT,str);
RNum[1]=atof(str);
A_Op=FALSE;
}
break;
case IDC_BUTTONN5://数字5
{
if(A_Op)
{
SetDlgItemText(hwnd,IDC_EDIT,NULL);
}
GetDlgItemText(hwnd,IDC_EDIT,str,sizeof(str));
strcat(str,"5");
SetDlgItemText(hwnd,IDC_EDIT,str);
RNum[1]=atof(str);
A_Op=FALSE;
}
break;
case IDC_BUTTONN6://数字6
{
if(A_Op)
{
SetDlgItemText(hwnd,IDC_EDIT,NULL);
}
GetDlgItemText(hwnd,IDC_EDIT,str,sizeof(str));
strcat(str,"6");
SetDlgItemText(hwnd,IDC_EDIT,str);
RNum[1]=atof(str);
A_Op=FALSE;
}
break;
case IDC_BUTTONN7://数字7
{
if(A_Op)
{
SetDlgItemText(hwnd,IDC_EDIT,NULL);
}
GetDlgItemText(hwnd,IDC_EDIT,str,sizeof(str));
strcat(str,"7");
SetDlgItemText(hwnd,IDC_EDIT,str);
RNum[1]=atof(str);
A_Op=FALSE;
}
break;
case IDC_BUTTONN8://数字8
{
if(A_Op)
{
SetDlgItemText(hwnd,IDC_EDIT,NULL);
}
GetDlgItemText(hwnd,IDC_EDIT,str,sizeof(str));
strcat(str,"8");
SetDlgItemText(hwnd,IDC_EDIT,str);
RNum[1]=atof(str);
A_Op=FALSE;
}
break;
case IDC_BUTTONN9://数
用c语言编写的计算器源代码 来自淘豆网www.taodocs.com转载请标明出处.