http://acm.fzu.edu.cn/problem.php?pid=2182

Problem 2182 水题

Accept: 188    Submit: 277
Time Limit: 1000 mSec    Memory Limit : 32768 KB

 Problem Description

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

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

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

 Input

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

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

 Output

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

 Sample Input

12
If the day is done
If birds sing no more
If the wind has fiagged tired
Then draw the veil of darkness thick upon me
Even as thou hast wrapt the earth with
The coverlet of sleep and tenderly closed
The petals of the drooping lotus at dusk
From the travere
Whose sack of provisions is empty before the voyage is ended
Whose garment is torn and dustladen
Whose strength is exhausted remove shame and poverty
And renew his life like a flower under
The 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!

 Source

FOJ有奖月赛-2014年11月

 
 
 
分析:
 
 
其实就是一个字符串处理的题,关键在输入格式和次数,我只是没有多组数据就wa了一次,巨坑啊~~~
 
 
AC代码:
 
 #include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string.h>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <iomanip>
#include <vector>
#pragma comment(linker, "/STACK:1024000000,1024000000")
#pragma warning(disable:4786) using namespace std; const int INF = 0x3f3f3f3f;
const int MAX = + ;
const double eps = 1e-;
const double PI = acos(-1.0); char str;
int main()
{
int n;
while(~scanf("%d",&n))
{
getchar();
int i;
for(i = ;i < n;i ++)
{
int first = , ans = ;
while(scanf("%c" , &str ) && str != '\n')
{
if(str != ' ' && first)
ans ++;
else if(str == ' ')
first = ;
}
if(ans > )
cout << "Too hard!" << endl;
else
cout << "Too easy!" << endl;
}
}
return ;
}

我真二,竟然没有想到用gets(),再来个简单的。

 #include<stdio.h>
#include<string.h>
char s[],a[];
int main()
{
int n;
scanf("%d",&n);
getchar();
while(n--)
{
scanf("%s",a);
gets(s);
if(strlen(a)>)
printf("Too hard!\n");
else
printf("Too easy!\n");
}
return ;
}

fzuoj Problem 2182 水题的更多相关文章

  1. 烟大 Contest1024 - 《挑战编程》第一章:入门 Problem A: The 3n + 1 problem(水题)

    Problem A: The 3n + 1 problem Time Limit: 1 Sec  Memory Limit: 64 MBSubmit: 14  Solved: 6[Submit][St ...

  2. Poj1298_The Hardest Problem Ever(水题)

    一.Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar eve ...

  3. [POJ 1000] A+B Problem 经典水题 C++解题报告 JAVA解题报告

        A+B Problem Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 311263   Accepted: 1713 ...

  4. HDU 4716 A Computer Graphics Problem (水题)

    A Computer Graphics Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (J ...

  5. HDOJ(HDU) 1898 Sempr == The Best Problem Solver?(水题、、、)

    Problem Description As is known to all, Sempr(Liangjing Wang) had solved more than 1400 problems on ...

  6. zzulioj--1634--Happy Thanksgiving Day - A + B Problem(模拟水题)

     1634: Happy Thanksgiving Day - A + B Problem Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 136  ...

  7. HDU 5443 The Water Problem (水题,暴力)

    题意:给定 n 个数,然后有 q 个询问,问你每个区间的最大值. 析:数据很小,直接暴力即可,不会超时,也可以用RMQ算法. 代码如下: #include <cstdio> #includ ...

  8. HDU 5832 A water problem (水题,大数)

    题意:给定一个大数,问你取模73 和 137是不是都是0. 析:没什么可说的,先用char 存储下来,再一位一位的算就好了. 代码如下: #pragma comment(linker, "/ ...

  9. HDU-1032 The 3n+1 problem 模拟问题(水题)

    题目链接:https://cn.vjudge.net/problem/HDU-1032 水题 代码 #include <cstdio> #include <algorithm> ...

随机推荐

  1. MySQL主从架构之Master-Master互为主备

    前言 通常,为了简化逻辑,master会设置为只读,正常只通过slave进行读写. 若要两边都写,为了避免自增id冲突,一般会设置奇偶错开,即一台的自增ID均为奇数,另一台均为偶数. 基本原理 首先, ...

  2. synchronized的使用方法

    [转自] http://blog.csdn.net/witsmakemen/article/details/6966116 记下来,很重要. Java语言的关键字,当它用来修饰一个方法或者一个代码块的 ...

  3. MyEclipse8.5 以debug模式启动tomcat6.0服务器 报错cannot connect to vm。

    打开MyEclipse8.5 想以debug模式启动tomcat6.0服务器,报  a configuration error occurred during startup.please verif ...

  4. Groovy 在eclipse中的使用

    今天在写Groovy脚本的时候发现一个问题.如下图,element的elementIterator()方法不能智能显示,只能手动输入.而在eclipse中如果类a没有方法a,那么你是用"cl ...

  5. Javascript正则表达式验证邮箱地址

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> < ...

  6. xcode7的那些坑-“Your binary is not optimized for iPhone 5” (ITMS-90096) when submitting

    用Xcode7向App Store提交二进制文件是,提示ERROR ITMS-90096:"You binary is not optimized for iPhone 5...." ...

  7. IN和exists 之间的比较

    IN和exists 之间的比较 NOT IN 和 NOT EXISTS之间的比较

  8. spring mvc 静态资源 404问题

    spring mvc 静态资源 404问题 在web.xml配置servlet-mapping的时候,如果url-pattern设置为"/" (如下),很多人都会遇到导入js,cs ...

  9. 通过SessionID和用户名来保证同一个用户不能同时登录(单点登录)

    可以通过SessionID和用户名来保证同一个用户不能同时登录的问题,下面程序模仿了QQ的登录,当登录后判断当前帐号是否已经登录,如果登录.则踢掉以前登录的用户. 1.通过Application全局变 ...

  10. python笔记 - day4-之装饰器

                 python笔记 - day4-之装饰器 需求: 给f1~f100增加个log: def outer(): #定义增加的log print("log") ...