UVA 621

#include<iostream>
#include<string>
using namespace std;
int main()
{
    int n;
    cin>>n;
    cin.ignore();
    while(n--)
    {
        string  m;
        getline(cin,m);
        if(m.compare("78")==0||m.compare("1")==0||m.compare("4")==0)
            cout<<"+"<<endl;
        else  if(m[m.length()-2]=='3'&&m[m.length()-1]=='5')
            cout<<"-"<<endl;
        else if(m[0]=='9'&&m[m.length()-1]=='4')
            cout<<"*"<<endl;
        else if(m.substr(0,3).compare("190")==0)
            cout<<"?"<<endl;
    }
    return 0;
}

 

posted @ 2012-04-28 12:07  open your eyes  阅读(189)  评论(0编辑  收藏  举报