题目: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 无聊恶心模拟题的更多相关文章

  1. poj 3371 Flesch Reading Ease

    http://poj.org/problem?id=3371 #include<cstdio> #include<cstring> #include<algorithm& ...

  2. POJ 3371:Flesch Reading Ease 模拟

    Flesch Reading Ease Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2071   Accepted: 60 ...

  3. Flesch Reading Ease -POJ3371模拟

    Flesch Reading Ease Time Limit: 1000MS Memory Limit: 65536K Description Flesch Reading Ease, a reada ...

  4. Flesch Reading Ease(模拟)

    http://poj.org/problem?id=3371 终于遇到简单一点的模拟题了.不过本人真心没有耐心读题目... 它的大致意思就是给一段合法的文章,求出这段文章的单词数,句子数,音节数,按照 ...

  5. Flesch Reading Ease (poj 3371)

    题意: 给出一篇规范的文章,求其 句子数.单词数 和 音节数把这3个值代入题目给出的公式,输出其结果,保留2位小数. 标记单词分隔符: 逗号(,) 和 空格( ) 句子分隔符:句号(.) 问号(?) ...

  6. POJ 3393 Lucky and Good Months by Gregorian Calendar 模拟题

    题目:http://poj.org/problem?id=3393 不多说了,简单模拟题,因为粗心写错了两个字母,导致错了N遍,模拟还是一贯的恶心,代码实在不想优化了,写的难看了点.. #includ ...

  7. poj 1008:Maya Calendar(模拟题,玛雅日历转换)

    Maya Calendar Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 64795   Accepted: 19978 D ...

  8. POJ 模拟题集合

    http://www.cppblog.com/Uriel/articles/101592.html 感觉这个暑假没有去年有激情啊,,,还没到状态就已经块上学了,,, 真是弱暴了,,,找几道模拟题刷刷. ...

  9. POJ 3923 Ugly Windows(——考察思维缜密性的模拟题)

    题目链接: http://poj.org/problem?id=3923 题意描述: 输入一个n*m的屏幕 该屏幕内有至少一个对话框(每个对话框都有对应的字母表示) 判断并输出该屏幕内处于最表层的对话 ...

随机推荐

  1. tomcat安全配置之证书密码加密存储

    最近项目组要完成一个新Web Servicer接口的开发,其中有项要求是支持外部客户程序以https方式访问这些SOAP接口.项目组当前基于tomcat6.0.29开发,axis版本为1.4.拿到这个 ...

  2. Redis学习手册(实例代码)

    在之前的博客中已经非常详细的介绍了Redis的各种操作命令.运行机制和服务器初始化参数配置.本篇博客是该系列博客中的最后一篇,在这里将给出基于Redis客户端组件访问并操作Redis服务器的代码示例. ...

  3. PHP获取IP所在地区(转)

    1.获取IP地址的API新浪的IP地址查询接口:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js新浪多地域测试方法:http:/ ...

  4. iOS 推送,当接到推送消息时如何处理?

    接收到通知时有两种进入的方式:1.当app未运行时(BOOL)application:(UIApplication *)application didFinishLaunchingWithOption ...

  5. android自定义View之NotePad出鞘记

    现在我们的手机上基本都会有一个记事本,用起来倒也还算方便,记事本这种东东,如果我想要自己实现,该怎么做呢?今天我们就通过自定义View的方式来自定义一个记事本.OK,废话不多说,先来看看效果图. 整个 ...

  6. bootstrap系列整理

    去年的九月份做第一版文档站时, 就开始尝试使用bootstrap ,由于当时对node 还一知半解,大部分精力放在nodejs上,bootstrap只是拿来就用,起步文档都没看: 当别人提到 Norm ...

  7. Import user's Environment path into Linux cron task

    How to use "cron" to create scheduled task Minimum time cycle: 1 minute Use crontab -e edi ...

  8. ArcGIS Server JavaScript API 各命名空间的含义【转】

    1.esri 命名空间      所有的对象都是在 esri 命名空间下的,esri 有自己的属性和方法.      如 esri.version 返回当前 JavaScript API 的版本号.e ...

  9. How to fix “The program can’t start because MSVCR110.dll is missing from your computer.” error on Windows

    原文出处 How to fix “The program can’t start because MSVCR110.dll is missing from your computer.” error ...

  10. jqery筛选

    <!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...