for(j = 0;j < lang[i].right.size();j ++){ string ss = lang[i].right[j]; string ok = \if(ss.length() > 2){
if((ss[1] > 'Z' || ss[1] < 'A') && (ss[0] <= 'Z' && ss[0] >= 'A')){ //Ua ok = \ok += ss[0]; ok += ss[1]; str.push_back(ok); }
if((ss[2] > 'Z' || ss[2] < 'A') && (ss[1] <= 'Z' && ss[1] >= 'A')){ //Ua ok = \ok += ss[1]; ok += ss[2]; str.push_back(ok); } } } }
for(i = 0;i < str.size();i ++){ for(j = 1;j < 9;j ++){
if(mtr[0][j] == str[i][1]){ //Find a Then Find LastVt(U)
for(int k = 0;k < lang.size();k ++){ if(lang[k].left == str[i][0]){ //Find U for(int p = 0;p < lang[k].last.size();p ++){ for(int q = 1;q < 9;q ++){ if(mtr[0][q] == lang[k].last[p]){ mtr[q][j] = '>'; } } } } } } } }
str.clear();
for(i = 0;i < lang.size();i ++){ //ab aUb a = b for(j = 0;j < lang[i].right.size();j ++){ string ss = lang[i].right[j]; string ok = \if(ss.length() > 2){
if((ss[1] > 'Z' || ss[1] < 'A') && (ss[0] > 'Z' || ss[0] < 'A')){ //aa ok = \ok += ss[0];
ok += ss[1]; str.push_back(ok); }
if((ss[2] > 'Z' || ss[2] < 'A') && (ss[1] > 'Z' || ss[1] < 'A')){ //aa ok = \ok += ss[1]; ok += ss[2]; str.push_back(ok); }
if((ss[2] > 'Z' || ss[2] < 'A') && (ss[0] > 'Z' || ss[0] < 'A')){ //aUa ok = \ok += ss[0]; ok += ss[2]; str.push_back(ok); } } } }
for(i = 0;i < str.size();i ++){ for(j = 1;j < 9;j ++){ if(str[i][0] == mtr[j][0]){ for(int k = 1;k < 9;k ++){
if(mtr[0][k] == str[i][1]){ mtr[j][k] = '='; } } } } }
for(i = 0;i < lang[0].first.size();i ++){ //# for(j = 1;j < 9;j ++){
if(lang[0].first[i] == mtr[0][j]){ mtr[8][j] = '<'; } } }
for(i = 0;i < lang[0].first.size();i ++){ //# for(j = 1;j < 9;j ++){
if(lang[0].first[i] == mtr[j][0]){ mtr[j][8] = '>'; } } }
mtr[8][8] = '=';
cout << \for(i = 0;i < 9;i ++){
for(j = 0;j < 9;j ++){ if(mtr[i][j] != 'n') cout << mtr[i][j] << \else cout << \}
cout << endl; }
cout << \cout << endl; }
void test(){
cout << \cout << \请输入算术表达式:\string str; cin >> str; str += '#'; int i,j,k; stack
char now = 'n'; //记录当前栈顶操作符 int sign = 0;
for(i = 0;i < str.length();i ++){