题目
分析
注意匹配的先后顺序..
代码
#include <stdio.h>
#include <string.h>
int main(void)
{
int t;
char s[5000];
scanf("%d", &t);
while (t--) {
scanf("%s", s);
if (!strcmp(s, "1") || !strcmp(s, "4") || !strcmp(s, "78"))
printf("+\n");
else if (s[strlen(s) - 2] == '3' && s[strlen(s) - 1] == '5')
printf("-\n");
else if (s[0] == '9' && s[strlen(s) - 1] == '4')
printf("*\n");
else if (s[0] == '1' && s[1] == '9' && s[2] == '0')
printf("?\n");
}
return 0;
}