Description: whether to add after-multiplication or after-Multiplication. Be sure to use long int # include <cstdio> # include <cstdlib> # include <cstring> char s [1010]. int main () {// freopen ("a.txt", "r", stdin); int n; scanf ("% d \ n", & n ); while (n --) {gets (s); long int num_min [100], num_max [100]; int max = 0, min = 0, flag = 0; int len = strlen (s); for (int I = 0; I <len; I ++) if (s [I]> = '0' & s [I] <= '9') {int c = 0, j; for (j = I; j <len; j ++) if (s [j]> = '0' & s [j] <= '9 ') c = c * 10 + s [j]-'0'; e Lse break; I = J-1; if (! Flag) {num_max [max ++] = c; num_min [min ++] = c;} else if (flag = 1) {num_min [min ++] = c; num_max [max-1] = num_max [max-1] + c;} else if (flag = 2) {num_max [max ++] = c; num_min [min-1] = num_min [min-1] * c;} else if (s [I] = '+') flag = 1; else if (s [I] = '*') flag = 2; for (int I = 1; I <max; I ++) num_max [0] = num_max [0] * num_max [I]; for (int I = 1; I <min; I ++) num_min [0] = num_min [0] + num_min [I]; printf ("The maximum and minimum are % lld and % lld. \ n ", num_max [0], num_min [0]);} return 0 ;}