Kattis - Aaah!
2017-01-14 18:33
447 查看
Aaah!
Photo by Unknown
Jon Marius shouted too much at the recent Justin Bieber concert, and now needs to go to the doctor because of his sore throat. The doctor’s instructions are to say “aaah”. Unfortunately, the doctors sometimes need Jon Marius to say “aaah” for a while, which Jon Marius has never been good at. Each doctor requires a certain level of “aah” – some require “aaaaaah”, while others can actually diagnose his throat with just an “h”. (They often diagnose wrongly, but that is beyond the scope of this problem.) Since Jon Marius does not want to go to a doctor and have his time wasted, he wants to compare how long he manages to hold the “aaah” with the doctor’s requirements. (After all, who wants to be all like “aaah” when the doctor wants you to go “aaaaaah”?)
Each day Jon Marius calls up a different doctor and asks them how long his “aaah” has to be. Find out if Jon Marius would waste his time going to the given doctor.
Input
The input consists of two lines. The first line is the “aaah” Jon Marius is able to say that day. The second line is the “aah” the doctor wants to hear. Only lowercase ’a’ and ’h’ will be used in the input, and each line will contain between 00 and 999999 ’a’s, inclusive, followed by a single ’h’.Output
Output “go” if Jon Marius can go to that doctor, and output “no” otherwise.Sample Input 1 | Sample Output 1 |
---|---|
aaah aaaaah | no |
Sample Input 2 | Sample Output 2 |
---|---|
aaah ah | go |
题意
判断那人要不要去看医生,如果前面的字符串比后面的短,证明不用,否则就用思路
比较字符串长度代码
#include<bits/stdc++.h> using namespace std; char a1[1005],a2[1005]; int main() { while (~scanf("%s %s", a1,a2)) { puts(strlen(a1) < strlen(a2) ? "no" : "go"); } return 0; }
相关文章推荐
- 学习笔记之iptables(二)
- IQKeyBoardManager按钮"Done"能否改为"完成",能的话怎么改?
- Java 播放多媒体 谈Java Media Framework
- 菜单基本操作(二)
- iOS网络
- Note06
- 倍增法求LCA的模板
- 链表中倒数第k个结点
- 【leetcode】【Easy】【461. Hamming Distance】【bit manipulation】
- [00803]让对象支持上下文管理协议
- 基于64位win10系统离线配置Android Studio
- Kattis - Fenwick Tree(树状数组区间更新单点求值)
- 【Zookeeper】源码分析之持久化(三)之FileTxnSnapLog
- deepin linux mysql工具
- XUtils—支持大文件上传,更全面的网络工具
- 区块链专家技能图谱
- 英语学术论文常用句型
- 【c语言】模拟实现strcat()、strncat()函数
- 【C++】Loki库源码读解随想
- Note05