#include typedef unsigned short ushort; void numin(ushort index, ushort *numBox) { char str; for (ushort i = 0; i '9') cnt++; else numBox[cnt] = numBox[cnt] * 10 + (ushort)str - (ushort)'0'; } } int main() { ushort number=0; ushort total =0; ushort value[50]; scanf("%hu", &number); scanf("%hu", &total); numin(number, value); ushort ans = value[0]; ushort cnt = 2; unsigned long long switcher = 0; while (1) { // 計算 if ((switcher >> cnt) & 1) ans *= value[cnt + 1]; else ans += value[cnt + 1]; if (cnt < number - 2) { cnt++; }else{ if (ans == total) break; else { ans = value[0]; cnt = 0; switcher++; continue; } } } for (int i = 0; i < number - 1; i++) { if((switcher >> i) & 1) printf("*"); else printf("+"); } return 0; }