UVA621
来源:互联网 发布:php用echo输出表格 编辑:程序博客网 时间:2024/05/29 14:03
水题,判断一下输入数字的格式。输出+ - *? ,每个符号对应的是一种格式。
AC代码:
#include<stdio.h>#include<iostream>#include<string>using namespace std;int main () {int t;string num;scanf("%d",&t);getchar();while (t--) {getline (cin ,num);int len = num.size();if (num == "1"|| num == "4"||num == "78") {printf("+\n");continue;}if (num[len -1] == '5' && num[len -2]== '3') {printf("-\n");continue;}if (num[len -1] == '4' && num[0] == '9') {printf("*\n");continue;}if (num[0] == '1' && num[1] == '9' && num[2] == '0')printf("?\n");}return 0;}
0 0
- uva621
- UVA621
- UVA621-秘密研究
- UVA621 - Secret Research
- tornado+ansible+twisted+mongodb运维自动化系统开发(一)
- UVA113
- Android网络编程(上)--- URL与HttpURLConnection
- 三十分钟掌握STL (3)
- HDU 4869 Turn the pokers(思维+组合公式+快速幂)
- UVA621
- Java HotSpot VM Options
- uva10954 - Add All(multiset函数)
- 指针变量
- 为何Android Auto未来会是行业规则改变者
- cocos2dx 网络编程(CCHttpRequest和CURL两个方式)
- Hibernate配置连接池
- poj 3273 二分
- bash编程入门