3708: The Key Locker of Cell Phone

3708: The Key Locker of Cell Phone 分享至QQ空间 去爱问答提问或回答

时间限制(普通/Java):1000MS/3000MS     内存限制:65536KByte
总提交: 517            测试通过:160

描述

A cell phone with an unlocked keypad has a funny way of causing a lot of grief. First the phantom phone calls start. Then the random numbers and symbols are punched into your keypad from bumping objects in your purse. Or perhaps you suddenly realize you are accessing the Internet on your phone without knowing how. All of this can lead up to a cell phone bill full of charges you could have easily avoided if you just locked your cell phone keypad. There, now your cell phone keypad is locked. But wait--how do you unlock the keypad? The answer is easier than you think.

First, you press one button with the key to lock the keypad, the cell phone screen will display a quick indicator as follows:
(1) If you press the "OK" key, it will indicate that you should press asterisk sign (*) keys to unlock.
(2) Or else it will indicate that you should press the "OK" key first.
(3) If you press one key and does not press the other key after 5 seconds, you should start all over again.

Now given the two keys you pressed and the interval between two times of pressing, you should estimate whether your cell phone is unlocked or not.
You should assume that your cell phone is locked at the start.

输入

The input case contains two characters indicating the two press and one positive integer indicating the interval between two times of pressing, which separated with blank characters. the "OK" key is your enter key, which will be represented by '\n' in C/C++ Language and its ASCII value is 10.

输出

If the cell phone is unlocked, you should output 1 or else output 0.
 

样例输入

   
   
# * 5

样例输出

   
   
0
我的代码:
#include<stdio.h> int main() { int a;char b,c; scanf("%c %c %d",&b,&c,&a); if(b==10&&c=='*'&&a<=5)puts("1"); else puts("0"); }
//坑点,只有这么一种情况可以输出;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wumingiswu

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值