#include #include #include #include using namespace std; stack kurwa_stack; vector kurwa_symbols_stack; char kurwa[13][13] = { {' ', 'Z', 'E', 'R', 'T', 'D', 'F', 'i', '(', ')', '+', '*', '#'}, {'Z', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}, {'E', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '=', ' ', ' ', '='}, {'R', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '>', '=', ' ', '>'}, {'T', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '>', '>', ' ', '>'}, {'D', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '>', '>', '=', '>'}, {'F', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '>', '>', '>', '>'}, {'i', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '>', '>', '>', '>'}, {'(', ' ', '=', '<', '<', '<', '<', '<', '<', ' ', ' ', ' ', ' '}, {')', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '>', '>', '>', '>'}, {'+', ' ', ' ', ' ', '=', '<', '<', '<', '<', ' ', ' ', ' ', ' '}, {'*', ' ', ' ', ' ', ' ', ' ', '=', '<', '<', ' ', ' ', ' ', ' '}, {'#', ' ', '=', '<', '<', '<', '<', '<', '<', ' ', ' ', ' ', ' '} }; int get_index_by_row(char symbol) { for (int i = 1; i < 13; i++) if (kurwa[0][i] == symbol) return i; return 7; } int get_index_by_column(char symbol) { for (int i = 1; i < 13; i++) if (kurwa[i][0] == symbol) return i; return 7; } char search_relationship(char symbol1, char symbol2) { int i = get_index_by_row(symbol1); int j = get_index_by_column(symbol2); return kurwa[i][j]; } string get_expression(string str, int index) { string result = ""; //char last_ch = kurwa_stack.si while (str[index] != '<') { result += str[index--]; } return result; } string parse_relationship(string str) { string result = ""; for (int i = 1; i < str.length(); i++) { char last_ch = search_relationship(str[i - 1], str[i]); //kurwa_stack.push_back(last_ch); if (last_ch == '>') kurwa_symbols_stack.push_back(get_expression(str, i)); } return result; } int main(int argc, const char * argv[]) { char a, b; cin >> a >> b; kurwa_stack.push(a); kurwa_stack.push(b); cout << kurwa_stack.top(); /*string str; cout << "Enter new expression" << endl; cin >> str; cout << "Your result is " << parse_relationship(str) << endl; */ return 0; }