zoukankan      html  css  js  c++  java
  • virtual hust 2013.6.23 数学杂题基础题目 D

    题目:Secret Research

    思路:水题。。也是直接判断一下

    #include <cstring>
    #include <iostream>
    #include <algorithm>
    #include <cmath>
    #include <cstdio>
    using namespace std;
    bool positive(string s)
    {
        if(s=="1"||s=="4"||s=="78")
            return true;
        return false;
    }
    bool negative(string s)
    {
        int l=s.size();
        if(s[l-1]=='5'&&s[l-2]=='3')
            return true;
        return false;
    
    }
    bool failed(string s)
    {
        if(s[s.size()-1]=='4'&&s[0]=='9')
            return true;
        return false;
    }
    bool not_complete(string s)
    {
        if(s[0]=='1'&&s[1]=='9'&&s[2]=='0')
            return true;
        return false;
    }
    void solve(string s)
    {
        if(positive(s))
            printf("+
    ");
        else if(negative(s))
            printf("-
    ");
        else if(failed(s))
            printf("*
    ");
        else
            printf("?
    ");
    }
    int main()
    {
        int t;
        scanf("%d",&t);
        while(t--)
        {
            string s;
            cin>>s;
            solve(s);
        }
        return 0;
    }
    View Code
  • 相关阅读:
    get post 小结
    ddt 实例
    通俗大白话来理解TCP协议的三次握手和四次断开
    find xss
    use . adb . get wifi
    http bass
    mac 配置homebrew
    id 与 void * 转换
    Maven
    percent-encode 百分号编码
  • 原文地址:https://www.cnblogs.com/overflow/p/3150625.html
Copyright © 2011-2022 走看看