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. 【php学习】array_map,array_walk,array_filter的区别

    array_map(function($v){return $v+1;}, $array); array_walk($array, function($v, $k){...}); array_filt ...

  2. Jsoncpp 数组的使用

    JsonCpp 是一个C++用来处理JSON 数据的开发包.下面讲一下怎么使用JsonCpp来序列化和反序列化Json对象,以实际代码为例子. 反序列化Json对象 比如一个Json对象的字符串序列如 ...

  3. cookie函数

    function getcookie(){ var cookie={}; var all=document.cookie; if(all===""){ alert(2); retu ...

  4. [have_fun] 好玩哒小游戏

    好玩哒,打字小游戏:http://zty.pe/ 可好玩了,一起来玩吧!

  5. Java中对象构造

    构造函数 作用:在构造对象的同时初始化对象.java强制要求对象 诞生同时被初始化,保证数据安全. 调用过程和机制:①申请内存,②执行构造函数的函数体,③返回对象的引用. 特点:与类同名,无返回类型, ...

  6. CSS弹性盒布局

    <html> <head> <meta charset="utf-8"/> <title></title> <st ...

  7. 设计模式:迭代器模式(Iterator)

    定  义:提供一种方法顺序访问一个集合对象中的各个元素,而又不暴露该对象的内部元素. C#中实现,foreach 遍历

  8. Wordpress固定链接设置

    wordpress设置固定链接时,应该尽量注意一下几点: 1.不要让日期出现在固定链接里面. 2.不要让分类的链接出现在固定链接里面. 3.链接不要太深. 4.链接中不要出现中文. 5.文章最后可以加 ...

  9. eclipse有时候会报错:Cannot change version of project facet Dynamic Web Module to 2.5。这个错误不会影响程序的运行,不过看着总是不舒服。这个问题现在可以解决啦。

    把项目WEB-INF底下的web.xml文件头部的:     <?xml version="1.0" encoding="UTF-8"?> < ...

  10. ASP.NET MVC3 通过Url传多个参数方法

    MVC3通过URL传值,一般情况下都会遇到 [从客户端(&)中检测到有潜在危险的 Request.Path 值]的问题 这个问题的解决方法,我的其他博文已经有了说明,这里给出连接 ; [从客户 ...