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. jquery-1.10.2.min.js之Multiple markers at this line

    1.windows-preferences  输入validation 2. 点击进入  3. 将JavaScript validator for js files 的两个对勾去了就OK!     4 ...

  2. ACM高精度加减乘除模板

    [转]#include <iostream> #include <string> using namespace std; inline int compare(string ...

  3. PIGS(最大流)

    PIGS Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 18742   Accepted: 8511 Description ...

  4. [转]网络性能评估工具Iperf详解(可测丢包率)

    原文链接:安全运维之:网络性能评估工具Iperf详解:http://os.51cto.com/art/201410/454889.htm 参考博文:http://linoxide.com/monito ...

  5. 基于visual Studio2013解决C语言竞赛题之0509杨辉三角

     题目

  6. 正则表达式验证数字、汉字、电话号码,email,整数,浮点数

    验证数字的正则表达式集 验证数字:^[0-9]*$验证n位的数字:^\d{n}$验证至少n位数字:^\d{n,}$验证m-n位的数字:^\d{m,n}$验证零和非零开头的数字:^(0|[1-9][0- ...

  7. android网络编程注意事项之一:移动网络下,防止网络超时甚至连接不上,解决办法--为网络请求设置代理

    Android应用程序访问互联网资源时,在Wifi的情况下处理网络连接按照上文所讲述的方法步骤即可顺利实现:但如果当前Android设备的联网方式是通过移动运营商的网络服务为中转,间接访问的互联网资源 ...

  8. 正态分布(Normal distribution)又名高斯分布(Gaussian distribution)

    正态分布(Normal distribution)又名高斯分布(Gaussian distribution),是一个在数学.物理及project等领域都很重要的概率分布,在统计学的很多方面有着重大的影 ...

  9. 2008r2 做windows域控制器

    新配一个: 1.装DNS服务. 2.装domain管理. config domain: 客户端172.16.1.34  ping zyctest

  10. 在win8.1上用Bitvise SSH Server 6.24(原名winsshd)搭建SSH2服务器

    注意:此SSH是指运维领域的 SSH,不是指JavaWeb框架中的SSH. 运维领域:SSH=Secure Shell安全外壳协议 JavaWeb框架:SSH=Spring+Struts+Hibern ...