문제 링크
주어진 숫자를 특정 패턴에 부합하는지 판별하는 문제
주어진 조건에 맞게 분기해주면 된다.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define INF 1000000000
int t;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> t;
for (int tc = 1; tc <= t; tc++){
string s;
cin >> s;
int l = s.length();
if (s == "1" || s == "4" || s == "78")
cout << "+" << '\n';
else if (l >= 3 && s.substr(l-2, 2) == "35")
cout << "-" << '\n';
else if (l >= 3 && s[0] =='9' && s[l-1] == '4')
cout << "*" << '\n';
else if (l >= 4 && s.substr(0, 3) == "190")
cout << "?" << '\n';
}
}