题目地址:点击打开链接
C++代码:
#include <iostream>
#include <string>
using namespace std;
int main()
{
int n;
while(cin>>n)
{
while(n--)
{
string s;
cin>>s;
if(s=="1"||s=="4"||s=="78")
cout<<"+"<<endl;
else
{
int size=s.size();
if(size>=2&&s[size-1]=='5'&&s[size-2]=='3')
cout<<"-"<<endl;
else
{
if(s[0]=='9'&&s[size-1]=='4')
cout<<"*"<<endl;
else
{
cout<<"?"<<endl;
}
}
}
}
}
return 0;
}