fzuoj Problem 2182 水题
http://acm.fzu.edu.cn/problem.php?pid=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
Sample Output
Source
FOJ有奖月赛-2014年11月
#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 水题的更多相关文章
- 烟大 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 ...
- Poj1298_The Hardest Problem Ever(水题)
一.Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar eve ...
- [POJ 1000] A+B Problem 经典水题 C++解题报告 JAVA解题报告
A+B Problem Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 311263 Accepted: 1713 ...
- HDU 4716 A Computer Graphics Problem (水题)
A Computer Graphics Problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (J ...
- 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 ...
- 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 ...
- HDU 5443 The Water Problem (水题,暴力)
题意:给定 n 个数,然后有 q 个询问,问你每个区间的最大值. 析:数据很小,直接暴力即可,不会超时,也可以用RMQ算法. 代码如下: #include <cstdio> #includ ...
- HDU 5832 A water problem (水题,大数)
题意:给定一个大数,问你取模73 和 137是不是都是0. 析:没什么可说的,先用char 存储下来,再一位一位的算就好了. 代码如下: #pragma comment(linker, "/ ...
- HDU-1032 The 3n+1 problem 模拟问题(水题)
题目链接:https://cn.vjudge.net/problem/HDU-1032 水题 代码 #include <cstdio> #include <algorithm> ...
随机推荐
- JdbcTemplae使用入门&&Spring三种连接池配置&&Spring配置文件引用外部properties文件
JdbcTemplate的使用 Spring为了各种支持的持久化技术,都提供了简单操作的模版和回调. JdbcTemplate 简化 JDBC 操作HibernateTemplate 简化 Hiber ...
- java Semaphore
//Listing 6-4. Using a Counting Semaphore to Control Access to a Pool of Items import java.util.conc ...
- ubuntu如何开启root,如何启用Ubuntu中root帐号
jingyan.baidu.com/article/495ba84116104238b20ede62.html ubuntu如何开启root,如何启用Ubuntu中root帐号 | 浏览:8344 | ...
- 【nodejs】使用Node.js实现REST Client调用REST API
最近在产品中开发基于REST的API接口,结合自己最近对Node.js的研究,想基于它开发一个REST Client做测试之用. 通过初步研究,Node.js开发HTTP Client还是挺方便的. ...
- hive中的常用方法(case,cast,unix_timestamp)
1.case的用法 )格式1 case col when value then '' when value then '' else '' end )格式2 case when col='value' ...
- Servlet Threading Model
Servlet Threading Model The scalability issues of Java servlets are caused mainly by the server thre ...
- BI 商业智能理解结构图
本文章是在本人实习阶段对BI(商业智能 Business Intelligence)的理解:(如有不足之处请多指教,谢谢) BI 系统负责从多个数据源中搜集数据,并将这些数据进行必要的转换后存储到 ...
- Android Annotations 注解例子
1.AndroidAnnotations官网: http://androidannotations.org/ (也许你需要FQ) 2.eclipse中使用androidannotations的配置方法 ...
- undefined reference to `switch_dev_unregister'
编译内核时,使用默认的配置进行编译.出现错误:undefined reference to switch_dev_unregister',undefined reference toswitch_se ...
- c# ini file
ini文件主要用于保存配置.之前一直以为是当作普通文本进行操作,读取里面的内容,再自己解析读取的文本.后来发现已经有写好的api函数:WritePrivateProfileString()和GetPr ...