POJ 3371 Flesch Reading Ease 无聊恶心模拟题
题目:http://poj.org/problem?id=3371
无聊恶心题,还是不做的好,不但浪费时间而且学习英语。
不过为了做出点技术含量,写了个递归函数。。。
还有最后判断es,ed,le时只判断小写,因为想多了还错了一次。。
#include <stdio.h>
#include <string.h>
#include <ctype.h> bool is_sy(char c)
{
if(c > 'y' || c < 'A')return ;
if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' || c == 'y' || is_sy(c+))
return ;
return ;
} int main()
{
char s[];
int st = , sy = , wd = ;
while(scanf("%s", s) != EOF)
{
wd++;
int len = strlen(s);
if(s[len-] == '.' || s[len-] == '?' || s[len-] == ':' || s[len-] == ';' || s[len-] == '!')
st++;
while(!isalpha(s[len-]))
len--;
if(len <= )sy++;
else
{
if(is_sy(s[]))sy++;
for(int i = ; i < len; i++)
if(is_sy(s[i]) && !is_sy(s[i-]))sy++;
if(s[len-] == 'e' && !is_sy(s[len-]) && (s[len-] == 's' || s[len-] == 'd'))sy--;
if(s[len-] == 'e' && !is_sy(s[len-]) && s[len-] != 'l')sy--;
}
}
printf("%.2f\n", 206.835 - 1.015 * (1.0*wd/st) - 84.6 * (1.0*sy/wd));
return ;
}
Oo0O0oO
POJ 3371 Flesch Reading Ease 无聊恶心模拟题的更多相关文章
- poj 3371 Flesch Reading Ease
http://poj.org/problem?id=3371 #include<cstdio> #include<cstring> #include<algorithm& ...
- POJ 3371:Flesch Reading Ease 模拟
Flesch Reading Ease Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2071 Accepted: 60 ...
- Flesch Reading Ease -POJ3371模拟
Flesch Reading Ease Time Limit: 1000MS Memory Limit: 65536K Description Flesch Reading Ease, a reada ...
- Flesch Reading Ease(模拟)
http://poj.org/problem?id=3371 终于遇到简单一点的模拟题了.不过本人真心没有耐心读题目... 它的大致意思就是给一段合法的文章,求出这段文章的单词数,句子数,音节数,按照 ...
- Flesch Reading Ease (poj 3371)
题意: 给出一篇规范的文章,求其 句子数.单词数 和 音节数把这3个值代入题目给出的公式,输出其结果,保留2位小数. 标记单词分隔符: 逗号(,) 和 空格( ) 句子分隔符:句号(.) 问号(?) ...
- POJ 3393 Lucky and Good Months by Gregorian Calendar 模拟题
题目:http://poj.org/problem?id=3393 不多说了,简单模拟题,因为粗心写错了两个字母,导致错了N遍,模拟还是一贯的恶心,代码实在不想优化了,写的难看了点.. #includ ...
- poj 1008:Maya Calendar(模拟题,玛雅日历转换)
Maya Calendar Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 64795 Accepted: 19978 D ...
- POJ 模拟题集合
http://www.cppblog.com/Uriel/articles/101592.html 感觉这个暑假没有去年有激情啊,,,还没到状态就已经块上学了,,, 真是弱暴了,,,找几道模拟题刷刷. ...
- POJ 3923 Ugly Windows(——考察思维缜密性的模拟题)
题目链接: http://poj.org/problem?id=3923 题意描述: 输入一个n*m的屏幕 该屏幕内有至少一个对话框(每个对话框都有对应的字母表示) 判断并输出该屏幕内处于最表层的对话 ...
随机推荐
- Android音频底层调试-基于tinyalsa
因为Android中默认并没有使用标准alsa,而是使用的是tinyalsa.所以就算基于命令行的測试也要使用libtinyalsa.Android系统在上层Audio千变万化的时候,能够能这些个工具 ...
- redis-BOOK
https://www.gitbook.com/book/gnuhpc/redis-all-about/details
- Maven Build Profiles--reference
What is Build Profile? A Build profile is a set of configuration values which can be used to set or ...
- linux 修改文件时间
1.ls -l *.sh 2.touch -d "10/13/2013" *.sh [我想把所以的.sh文件修改到三个月前(2013年10月13)的时间.]3.ls -l *.sh ...
- 关于Fragment与Fragment、Activity通信的四种方式
一直想总结一下Fragment与Fragment.Activity通信的问题,今天有时间一共总结了三种,权当抛砖引玉,如果大家还有更好的方式来实现Fragment和Fragment.Activity的 ...
- 网页设定固定背景图片(抄袭自百度FM)
这个新技能,我是从百度FM中学习到的. 在网页中,有一个id为"body-bg"的层, html代码: <div id="body-bg" style=& ...
- (转)asp.net 高质量缩略图
原文地址:http://www.cnblogs.com/Fooo/archive/2009/06/19/1506381.html using System.Drawing; ------------- ...
- SqlServer查找表中多余的重复记录
1.查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断 select * from people where peopleId in (select peopleId from ...
- wap上传图片跨域发送post请求
wap和接口交互是跨域请求,一般只能通过Jsonp来进行数据的吞吐,然而jsonp只是GET请求,不能发送post请求,所以会对项目需求有所限制. 需求:wap跨域通过接口上传图片. 条件:接口是C# ...
- CA 配置网站映射