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. Open Sourcing Kafka Monitor

    https://engineering.linkedin.com/blog/2016/05/open-sourcing-kafka-monitor     https://github.com/lin ...

  2. TabHost详解

    [转]http://blog.csdn.net/harvic880925/article/details/17120325 前言:今天仔细研究了下TabHost,主要是为了实现微信底部导航栏的功能,最 ...

  3. js文档视口高度函数

    objwin=window;objBody=document.body;objDel=document.documentElement;   关于弹窗时候用到 function getPageHeig ...

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

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

  5. JS-004-判断元素显示状态

    在日常的 web 编程或 UI自动化脚本编写过程中,经常会遇到判断页面元素的显示状态,以对应的执行相应的操作.此文主要以 js 判断页面元素的存在状态为例,简单叙述一下 js 是如何判断元素的显示状态 ...

  6. JS实现动画原理一(闭包方式)

    前提:      你必须了解js的闭包(否则你看不懂滴)     我们就来做一个js实现jq animate的动画效果来简单探索一下,js动画实现的简单原理: html代码 <div id=&q ...

  7. 浅谈Java回调机制

    像许多网上介绍回调机制的文章一样,我这里也以一个现实的例子开头:假设你公司的总经理出差前需要你帮他办件事情,这件事情你需要花些时间去做,这时候总经理肯定不能守着你做完再出差吧,于是就他告诉你他的手机号 ...

  8. 使用for打印小九九

    使用shell的for语法打印小九九 #!/bin/bash `;do `;do if [ $a -ge $b ];then echo -en "$a x $b = $(expr $a \* ...

  9. POJ 1035题目描述

    Description You, as a member of a development team for a new spell checking program, are to write a ...

  10. shell脚本编程-循环(for、while、until)

    for命令格式:– list参数:迭代中要用的一系列值– 每个迭代中,变量var会包含列表中的当前值– do和done语句之间输入的命令可以是一条或多条标准的bash shell命令   1 2 3 ...