【題解】ZeroJudge e683: 00621 – Secret Research

【題目敘述】https://zerojudge.tw/ShowProblem?problemid=e683

#include <iostream>
using namespace std;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int T;
    string s;
    cin >> T;
    while (T--){
        cin >> s;
        if (s == "1" || s == "4" || s == "78"){
            cout << "+\n";
        } else if (s.substr(s.size()-2, 2) == "35"){
            cout << "-\n";
        } else if (s[0] == '9' && s[s.size()-1] == '4'){
            cout << "*\n";
        } else if (s.substr(0, 3) == "190"){
            cout << "?\n";
        } else {
            cout << "unknown\n";
        }
    }
    return 0;
}
分享本文 Share with friends