From 1ee802d8f2c46dc61b1c7805a364801a35866f79 Mon Sep 17 00:00:00 2001 From: Aleksey Lobanov Date: Sat, 8 May 2021 20:19:39 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=D1=8B=20=D0=BB?= =?UTF-8?q?=D0=B8=D1=88=D0=BD=D0=B8=D0=B5=20=D1=81=D0=BA=D0=BE=D0=B1=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D0=BE=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=BE=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BF=D1=80=D0=B5=D0=B4=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B9=20=D1=84=D1=83?= =?UTF-8?q?=D0=BD=D0=BA=D1=86=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 947c3c4..a8ad0fe 100644 --- a/main.cpp +++ b/main.cpp @@ -238,7 +238,7 @@ vector get_linear_combinations(const vector &linear_comp } string preprocess_factor(string factor) { - if ( factor.find("+") != string::npos and factor.find("*") == string::npos ) + if ( factor.find("+") != string::npos and factor.find("*") == string::npos and factor[0] !='(' and factor[factor.size() - 1] != ')') return "(" + factor + ")"; return factor; }