#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, i, j;
while(cin >> n)
{
for(i=1; i<=n; i++)
{
string s;
cin >> s;
int l = s.size();
if(s == "1" || s == "4" || s == "78")
{
cout << '+' << endl;
continue;
}
if(s[0] == '1' && s[1] == '9' && s[2] == '0' && s[l-2] != '3' && s[l-1] != '5')
{
cout << '?' << endl;
continue;
}
if(s[0] == '9' && s[l-1] == '4')
{
cout << '*' << endl;
continue;
}
if(s[l-2] == '3' && s[l-1] == '5')
{
cout << '-' << endl;
continue;
}
else
cout << '?' << endl;
}
}
return 0;
}
using namespace std;
int main()
{
int n, i, j;
while(cin >> n)
{
for(i=1; i<=n; i++)
{
string s;
cin >> s;
int l = s.size();
if(s == "1" || s == "4" || s == "78")
{
cout << '+' << endl;
continue;
}
if(s[0] == '1' && s[1] == '9' && s[2] == '0' && s[l-2] != '3' && s[l-1] != '5')
{
cout << '?' << endl;
continue;
}
if(s[0] == '9' && s[l-1] == '4')
{
cout << '*' << endl;
continue;
}
if(s[l-2] == '3' && s[l-1] == '5')
{
cout << '-' << endl;
continue;
}
else
cout << '?' << endl;
}
}
return 0;
}
Comments
Post a Comment