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[],a2[];
int main() {
while (~scanf("%s %s", a1,a2))
{
puts(strlen(a1) < strlen(a2) ? "no" : "go");
}
return ;
}

最新文章

  1. Android中下载、安装和卸载(原)
  2. Objective-C数据类型之id,SEL,BOOL,nil,NULL和NSNull
  3. IE8下调用Active控件
  4. EntityFramework+WCF
  5. 技术英文单词贴--W
  6. 实现Java JTable的应用案例
  7. BZOJ 4199 品酒大会
  8. Unity3D脚本中文系列教程(十六)
  9. java线程(四)
  10. 【Java学习笔记之十一】Java中常用的8大排序算法详解总结
  11. spring的PathVariable和value={}小技巧(shiro项目中来的三)
  12. SpringBoot(四)SpringBoot中lombok使用
  13. git基本用法
  14. JavaScript对象访问器属性
  15. PHP操作实现一个多功能购物网站
  16. 算法实践--不相交集合(Disjoint Sets)
  17. Javascript - 预编译与函数词法作用域
  18. asp.net 读取word 文档的方法
  19. 修改MySQL数据文件的位置
  20. Android安装包apk文件在某些版本操作系统上安装解析包出错问题的解决办法

热门文章

  1. 通过SqlClr制作Sql自动化批量执行脚本
  2. 推荐一个比较好的VBS编辑器
  3. extjs 时间可选择时分
  4. FileWriter字符输出流和FileReader字符输出流
  5. Date与SimpleDateFormat
  6. MSDN官方XmlSerializer类导致内存泄漏和性能低
  7. Essential C#读书笔记
  8. WinForm中使MessageBox实现可以自动关闭功能
  9. SHELL编程笔记(二)之shell流程控制
  10. HDU--杭电--3415--Max Sum of Max-K-sub-sequence--暴力或单调队列