题意:

  给出一篇规范的文章,求其 句子数、单词数 和 音节数把这3个值代入题目给出的公式,输出其结果,保留2位小数。

  标记单词分隔符: 逗号(,) 和 空格( )

  句子分隔符:句号(.) 问号(?) 冒号(:) 分号(;) 感叹号(!)

  音节处理要求:

  (1)当单词总长度<=3时,音节数无条件+1

  (2) 当单词总长度>3时,单词中每出现一个元音字母(a、e、i、o、u、y),音节数+1,但是连续的(>=2)元音字母只按1个音节计算,且当单词后缀为-es、-ed和-e时,后缀的元  音字母e不列为音节数计算。但是后缀-le例外,要计算音节数。

ans=206.835-1.015*(danci/jvzi)-84.6*(yinjie/danci)

#include<cstdio>
#include<iostream>
#define N 1010
using namespace std;
char ci[N];
double danci,jvzi,yinjie;
bool yuan(char c)
{
if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'||c=='y')return true;
return false;
}
int main()
{
char c;int num=;
while(scanf("%c",&c)!=EOF)
{
if(c==','||c==' ')
{
if(num<=)yinjie++;
else
{
for(int i=;i<=num;i++)
{
if(yuan(ci[i])&&!yuan(ci[i-]))
{
if((i==num-&&ci[i]=='e'&&(ci[num]=='s'||ci[num]=='d'))||(i==num&&ci[i]=='e'&&ci[num-]!='l'));
else yinjie++;
}
}
}
danci++;
num=;
}
else if(c=='.'||c=='?'||c==':'||c==';'||c=='!')jvzi++;
else ci[++num]=c;
}
double ans=206.835-1.015*(danci/jvzi)-84.6*(yinjie/danci);
printf("%.2lf",ans);//G++不能用%lf ,要用%f
return ;
}

Flesch Reading Ease (poj 3371)的更多相关文章

  1. POJ 3371:Flesch Reading Ease 模拟

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

  2. Flesch Reading Ease -POJ3371模拟

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

  3. 01背包问题:Charm Bracelet (POJ 3624)(外加一个常数的优化)

    Charm Bracelet    POJ 3624 就是一道典型的01背包问题: #include<iostream> #include<stdio.h> #include& ...

  4. Scout YYF I(POJ 3744)

    Scout YYF I Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5565   Accepted: 1553 Descr ...

  5. 广大暑假训练1(poj 2488) A Knight's Journey 解题报告

    题目链接:http://vjudge.net/contest/view.action?cid=51369#problem/A   (A - Children of the Candy Corn) ht ...

  6. Games:取石子游戏(POJ 1067)

    取石子游戏 Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 37662   Accepted: 12594 Descripti ...

  7. BFS 或 同余模定理(poj 1426)

    题目:Find The Multiple 题意:求给出的数的倍数,该倍数是只由 1与 0构成的10进制数. 思路:nonzero multiple  非零倍数  啊. 英语弱到爆炸,理解不了题意... ...

  8. 并查集+关系的传递(poj 1182)

    题目:食物链 题意:给定一些关系.判断关系的正确性,后给出的关系服从之前的关系: 思路:难点不在并查集,在于关系的判断,尤其是子节点与根节点的关系的判断: 这个关系看似没给出,但是给出子节点与父节点的 ...

  9. 昂贵的聘礼(poj 1062)

    Description 年轻的探险家来到了一个印第安部落里.在那里他和酋长的女儿相爱了,于是便向酋长去求亲.酋长要他用10000个金币作为聘礼才答应把女儿嫁给他.探险家拿不出这么多金币,便请求酋长降低 ...

随机推荐

  1. Android Studio学习笔记

    转:http://stormzhang.com/devtools/2014/11/25/android-studio-tutorial1 背景 相信大家对Android Studio已经不陌生了,An ...

  2. Codeforces 295A Greg and Array

    传送门 A. Greg and Array time limit per test 1.5 seconds memory limit per test 256 megabytes input stan ...

  3. Codeforces 548B Mike and Fun

    传送门 B. Mike and Fun time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  4. python学习易错点1

    1.>>> d = {'x': 'A', 'y': 'B', 'z': 'C' } >>> for k, v in d.iteritems(): ... print ...

  5. shell与变量的声明的操作

    1.给命令起别名:alias 执行下面命令后,可以使用dir代替ls –l 命令,显示目录中的文件详细信息: 还可以用一个别名表示几个命令 的结合: 2.ps:显示当前登录会话的所有活动进程: 3.更 ...

  6. Jquery,ajax返回json数据后呈现到html页面的$.post方式。

    ------------------------------------------------------完整版------------------------------------------- ...

  7. 关于angularjs 中自定义过滤器

    包子认为,在angularjs中,经常需要用到自定义过滤器,来过滤相应的功能,自定义过滤器非常的简单,我就直接贴代码啦 其中input就是你需要进行操作的对象,,,用法就直接就是 是不是很easy.. ...

  8. thinkphp中F方法

    我们已经了解了ThinkPHP中的S方法的用法,F方法其实是S方法的一个子集功能,仅用于简单数据缓存,并且只能支持文件形式,不支持缓存有效期,因为采用的是PHP返回方式,所以其效率较S方法较高,因此我 ...

  9. quaternion*Vector3的新理解

    原地址:http://www.cnblogs.com/88999660/p/3262656.html using UnityEngine; using System.Collections; publ ...

  10. Insertion Sort List

    对链表进行插入排序,比对数组排序麻烦一点. ListNode *insertSortList(ListNode *head) { ListNode dummy(-); for (ListNode *c ...