水题,简单。
1 #include<iostream> 2 #include<cstring> 3 4 using namespace std; 5 6 int main() 7 { 8 int n; 9 char str[10000]; 10 cin >> n; 11 while(n--) 12 { 13 cin >> str; 14 if (!strcmp(str, "1") || !strcmp(str, "4") || !strcmp(str, "78")) 15 cout << "+" << endl; 16 else if (str[strlen(str)-1] == '5' && str[strlen(str)-2] == '3') 17 cout << "-" << endl; 18 else if (str[0] == '9' && str[strlen(str)-1] == '4') 19 cout << "*" << endl; 20 else if (str[0] == '1' && str[1] == '9' && str[2] == '0') 21 cout << "?" << endl; 22 } 23 return 0; 24 }