水题

D - 水题
Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u

Description

胖哥自从当上公务员,赢取白富美,走向人生巅峰后,已经懒散到不想出题了,不仅如此,他连题目都懒得看了,现在他只会根据题目第一个单词的长度判定这个题目的难度

如果题目的第一个单词太长(长度大于3),他会说这题太难,不可能想的出来; 如果题目的第一个单词太短(长度不大于3),他会说这题太简单,懒得去想

现在给定一个题目,L想知道胖哥对于这道题会作出什么反应

Input

首先是一个正整数cas,表示有cas组输入,cas<=100

对于每组输入,会给出一行,每行表示一个题目,每个题目只会由大写字母,小写字母或者空格构成,每行的第一个字符一定不会是空格,多个空格可能连续出现,每行最多200个字符

Output

对于每个题目,如果胖哥觉得这题太难,输出"Too hard!",否则输出"Too easy!"

Sample Input

12If the day is doneIf birds sing no moreIf the wind has fiagged tiredThen draw the veil of darkness thick upon meEven as thou hast wrapt the earth with The coverlet of sleep and tenderly closedThe petals of the drooping lotus at duskFrom the travereWhose sack of provisions is empty before the voyage is endedWhose garment is torn and dustladenWhose strength is exhausted remove shame and povertyAnd renew his life like a flower underThe cover of thy kindly night

Sample Output

Too easy!Too easy!Too easy!Too hard!Too hard!Too easy!Too hard!Too hard!Too hard!Too hard!Too easy!Too easy!
正确代码如下,注意字符串的处理

#include<stdio.h>

#include<string.h>
int main()
{
    int t,i,len;
    scanf("%d",&t);
    getchar();
    while(t--)
    {
      len=0;
      int i;
      char a[201];
      gets(a);
      for(i=0;a[i]!='\0';i++)
      {
          if(a[i]!=' ')
            len++;
          else
            break;
      }
      if(len>3)
        printf("Too hard!\n");
      else
        printf("Too easy!\n");
    }
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值