解决了:
void CCalculatorDlg::cal()
{
int curi=0,flagg=0,flagg1=0;
double nown=1,kret[15];
for(int i=1;i<15;i++)
{
switch(m_Operation[i])
{
case 3:
if (flagg==0)//第一次
{
nown=m_number[i]*m_number[i+1];
flagg=1;
}
else
{
nown*=m_number[i+1];
}
break;
case 4:
if (flagg==0)//第一次
{
nown=(double)m_number[i]/m_number[i+1];
flagg=1;
}
else
{
nown=(double)nown/m_number[i+1];
}
break;
case 1:
case 2:
if (flagg==1)
{
kret[curi++]=nown;
}
case 999://运算结束
if (m_Operation[i-1]==3 || m_Operation[i-1]==4)
{//最后一个操作符是乘或除的话
kret[curi++]=nown;
flagg1=1;
}
break;
}
if (flagg1==1)
{
break;
}
}
int nowq=0;
if (m_Operation[1]==3 || m_Operation[1]==4)
{
m_result=kret[nowq++];
}
else
{
m_result=m_number[1];
}
for(i=1;i<15;i++)
if(m_Operation[i]==1)
if (m_Operation[i+1]==3 || m_Operation[i+1]==4)
m_result=m_result+kret[nowq++];
else
m_result=m_result+m_number[i+1];
else if (m_Operation[i]==2)
if (m_Operation[i+1]==3 || m_Operation[i+1]==4)
m_result=m_result-kret[nowq++];
else
m_result=m_result-m_number[i+1];
UpdateData(FALSE);
}