Saturday, May 14, 2016

UVA 621 Secret Research - solution

Unknown
#include<iostream>
#include<string>

using namespace std;
int main()
{
    int n;
    string s;
    cin>>n;
    while (n--)
    {
        cin>>s;
        if(s=="1" || s=="4" || s=="78") cout<<"+"<<endl;
        else if(s[s.length()-1]=='5' && s[s.length()-2]=='3')
        cout<<"-"<<endl;
        else if(s[s.length()-1]=='4' && s[0]=='9')
        cout<<"*"<<endl;
        else if(s[0]=='1' && s[1]=='9' && s[2]=='0')
        cout<<"?"<<endl;
     }
     return 0;
}

Unknown

Studying at Shahjalal University of Science and Technology, Sylhet.

0 comments:

Post a Comment

Coprights @ 2016,