水题

来源:互联网 发布:耳饰饰品店 知乎 编辑:程序博客网 时间:2024/06/06 06:29

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

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
原创粉丝点击