if(ch>='0' && ch<='9')
{
flag=1;
sum=0;
sum1=0;
int now=0;
while(ch>='0' && ch<='9' || '.'==ch)
{
if('.'==ch)
{
now=1;
flag=0;
ch=prog[++p];
continue;
}
if(0==now) sum=sum*10+ch-'0';
else sum1=sum1*10+ch-'0';
ch=prog[++p];
}
ch=prog[--p];syn=11;
}
实验三多出来的操作:
void emit(char *result,char *aq1,char *op,char *aq2)
{
strcpy(quad[count].result,result);
strcpy(quad[count].aq1,aq1);
strcpy(quad[count].op,op);
strcpy(quad[count].aq2,aq2);
++count;
}