//4_7_22: Experssion Evaluator ++和--字符串的求值 POJ3337
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
int i,j,T,value,length,flag[30],alpha[30];
char sign,enter,str[100],ans[100],org[100];
scanf("%d%c",&T,&enter);
while(T --)
{
cin.getline(str,1000);
for(i = 0;i < 26;i ++)
alpha[i] = i + 1;
memset(flag,0,sizeof(flag));
strcpy(ans,str);
for(i = 0;i < strlen(str);i ++)
while(str[i] == ' ')
for(j = i;j < strlen(str);j ++)
str[j] = str[j + 1];
strcpy(org,str);
length = strlen(str);
i = value = 0;
while(org[i])
{
if(org[i] >= 'a' && org[i] <= 'z')
{
if(i > 1 && org[i - 1] == '+' && org[i - 2] == '+')
{
str[i - 1] = ' ';
s
POJ3337 Experssion Evaluator
最新推荐文章于 2015-12-20 10:24:25 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)