Secret Research 

At a certain laboratory results of secret research are thoroughly encrypted. A result of a single experiment is stored as an information of its completion:

`positive result',`negative result',`experiment failed' or`experiment not completed'

The encrypted result constitutes a string of digits S, which may take one of the following forms:



positive result S = 1 or S = 4 or S = 78

negative result S = S35

experiment failed S = 9S4

experiment not completed S = 190S

(A sample result S35 means that if we add digits 35 from the right hand side to a digit sequence then we shall get the digit sequence corresponding to a failed experiment)

You are to write a program which decrypts given sequences of digits.

Input

A integer
n stating the number of encrypted results and thenconsecutive
n lines, each containing a sequence of digits given as ASCII strings.

Output

For each analysed sequence of digits the following lines should be sent to output (in separate lines):


+ for a positive result
- for a negative result
* for a failed experiment
? for a not completed experiment

In case the analysed string does not determine the experiment result, a first match from the above list should be outputted.

Sample Input

4
78
7835
19078
944

Sample Output

+
-
?
*
#include<stdio.h>
#include<string.h>
int main()
{
int n;
scanf("%d",&n);
while(n--)
{
char a[1005]={0};
scanf("%s",a);
if(strlen(a)<=2)
puts("+");
else if(a[strlen(a)-1]=='5'&&a[strlen(a)-2]=='3')
puts("-");
else if(a[0]=='9'&&a[strlen(a)-1]=='4')
puts("*");
else if(a[0]=='1'&&a[1]=='9'&&a[2]=='0')
puts("?");
}
return 0;
}

621 - Secret Research的更多相关文章

  1. UVA题目分类

    题目 Volume 0. Getting Started 开始10055 - Hashmat the Brave Warrior 10071 - Back to High School Physics ...

  2. Volume 1. Maths - Misc

    113 - Power of Cryptography import java.math.BigInteger; import java.util.Scanner; public class Main ...

  3. poj3708(公式化简+大数进制装换+线性同余方程组)

    刚看到这个题目,有点被吓到,毕竟自己这么弱. 分析了很久,然后发现m,k都可以唯一的用d进制表示.也就是用一个ai,和很多个bi唯一构成. 这点就是解题的关键了. 之后可以发现每次调用函数f(x),相 ...

  4. poj 3708 Recurrent Function

    Recurrent Function Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 1233   Accepted: 336 ...

  5. PHP serialize && unserialize Security Risk Research

    目录 . 序列化的定义 . serialize:序列化 . unserialize:反序列化 . 序列化.反序列化存在的安全风险 . Use After Free Vulnerability -] . ...

  6. The top 100 papers Nature explores the most-cited research of all time.

    The top 100 papers Nature explores the most-cited research of all time. The discovery of high-temper ...

  7. 【oneday_onepage】——The Secret Of Steve<1>

    The Secret Of SteveThe secret of Steve is simple. It explains his success and excess. It exemplifies ...

  8. Android Secret Code

    我们很多人应该都做过这样的操作,打开拨号键盘输入*#*#4636#*#*等字符就会弹出一个界面显示手机相关的一些信息,这个功能在Android中被称为android secret code,除了这些系 ...

  9. ASP.NET OAuth:access token的加密解密,client secret与refresh token的生成

    在 ASP.NET OWIN OAuth(Microsoft.Owin.Security.OAuth)中,access token 的默认加密方法是: 1) System.Security.Crypt ...

随机推荐

  1. Maxicode码

    Maxicode的缘起和发展 1980年代晚期,美国知名的UPS(United Parcel Service)快递公司认知到利用机器辨读资讯可有效改善作业效率.提高服务品质,故从1987年开始着手於机 ...

  2. 基于visual Studio2013解决C语言竞赛题之0203格式化输出

     题目 解决代码及点评 #include <stdio.h> #include <stdlib.h> void main() { // print是输出函数,参数%s表示输 ...

  3. 复习知识点:TabBarViewController(微信框架)

    TabBarViewController:标签视图控制器 在application设置 创建四个视图控制器 引入视图控制器头文件 #import "AppDelegate.h" # ...

  4. 1297 - Largest Box(三分)

    1297 - Largest Box   PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB In t ...

  5. (Java随机数举例)随机扔一千次硬币的正反次数

    方法一: public class coin{ public static void main(String args[]){ int n = 0; int m = 0; int len = 1000 ...

  6. 欧拉函数K - Relatives

    欧拉函数是积性函数——若m,n互质,φ(mn)=φ(m)φ(n). 特殊性质:当n为奇数时,φ(2n)=φ(n), φ(x)=x(1-1/p1)(1-1/p2)(1-1/p3)(1-1/p4)…..( ...

  7. Talented Chef(简单题,被我想的太复杂了,用复杂的方法当然会超时咯,由此可见,并非所有题都是想的越多越好)

    Description As we all know, Coach Gao is a talented chef, because he is able to cook M dishes in the ...

  8. 循环次数( M - 暴力求解、打表)

    循环次数 Description           我们知道,在编程中,我们时常需要考虑到时间复杂度,特别是对于循环的部分.例如,         如果代码中出现         for(i=1;i ...

  9. python成长之路——第二天

    cpython:c解释器  .pyc(字节码)——机器码 jpython :java解释器   java字节码   ironpython :C#解释器   C#字节码   .... 上面的:编译完之后 ...

  10. 独立搭建zookeeper

    1.如果你装了带有zookeeper的Hbase版本,先把hbase-env.sh   export HBASE_MANAGES_ZK=false 设置为false 见下图 2.下载安装zookeep ...