virtual hust 2013.6.23 数学杂题基础题目 D - Secret Research
思路:水题。。也是直接判断一下
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#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("+\n"); else if(negative(s)) printf("-\n"); else if(failed(s)) printf("*\n"); else printf("?\n"); } int main() { int t; scanf("%d",&t); while(t--) { string s; cin>>s; solve(s); } return 0; }
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步