zrq495
www.zrq495.com

水题,简单。

 

 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 }
posted on 2012-07-24 19:19  zrq495  阅读(241)  评论(0编辑  收藏  举报