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> ...
随机推荐
- The world beyond batch: Streaming 101
https://www.oreilly.com/ideas/the-world-beyond-batch-streaming-101 https://www.oreilly.com/ideas/the ...
- java 开发, jdk 1.6 官方下载地址
在oracle官方网站默认下载的jdk是最新的,目前正式版是1.8. 但有些项目要求是1.6的jdk,费了九牛二虎之力终于找到了1.6的官方版本,链接如下: http://www.oracle.com ...
- C、VDD、VSS、 VEE 和VPP的区别
http://www.cnblogs.com/crazybingo/archive/2010/05/14/1735802.html C.VDD.VSS. VEE 和VPP的区别 在电子电路中,常可以看 ...
- C#窗体:关于DataGridView的数据源绑定字符串两个值得注意的问题
无意间遇到的问题,然后就GOOGLE了下,搜到些资料,总结整理如下(注:是转载的) 1. LINQ的查询结果无法直接作为DataGridView的数据源 DataGridView的DataSource ...
- Qt 无边框窗体改变大小 完美实现(全部自己实现)
近期,做项目用到无边框窗体,令人蛋疼的是无边框窗体大小的改变要像右边框那样,上下左右四周,而且要流畅. 网上也找了些代码,发现居然还要连接到windows事件,这显然不合常理,后来自己新建了demo, ...
- php--yii2.0框架的curl
yii2.0框架的增删改查 //插入操作 save() $customer=new Customer(); $customer->name=‘小熊‘; $customer->save() ...
- LightOj 1024 - Eid (求n个数的最小公约数+高精度)
题目链接:http://lightoj.com/volume_showproblem.php?problem=1024 题意:给你n(2<=n<=1000)个数, 然后求n个数的最小公倍数 ...
- java 获取请求客户端的真实IP地址
转载自:http://leiyongping88.iteye.com/blog/1545930 用request.getRemoteAddr();方法获取的IP地址是:127.0.0.1或192.16 ...
- https://www.zhihu.com/question/52020960#answer-47024535
https://www.zhihu.com/question/52020960#answer-47024535
- Ext中解析字符串
Ext.encode()将json转为json字符串Ext.decode()将json字符串转为json