1658: Easier Done Than Said?

Time Limit: 1 Sec  Memory Limit: 64 MB
Submit: 15  Solved: 12
[Submit][Status][Web Board]

Description

Password security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some sites use random computer-generated passwords (like xvtpzyo), but users have a hard time remembering them and sometimes leave them written on notes stuck to their computer. One potential solution is to generate "pronounceable" passwords that are relatively secure but still easy to remember. FnordCom is developing such a password generator. You work in the quality control department, and it's your job to test the generator and make sure that the passwords are acceptable. To be acceptable, a password must satisfy these three rules: It must contain at least one vowel. It cannot contain three consecutive vowels or three consecutive consonants. It cannot contain two consecutive occurrences of the same letter, except for 'ee' or 'oo'. (For the purposes of this problem, the vowels are 'a', 'e', 'i', 'o', and 'u'; all other letters are consonants.) Note that these rules are not perfect; there are many common/pronounceable words that are not acceptable.

Input

The input consists of one or more potential passwords, one per line, followed by a line containing only the word 'end' that signals the end of the file. Each password is at least one and at most twenty letters long and consists only of lowercase letters.

Output

For each password, output whether or not it is acceptable, using the precise format shown in the example.

Sample Input

a
tv
ptoui
bontres
zoggax
wiinq
eep
houctuh
end

Sample Output

<a> is acceptable.
<tv> is not acceptable.
<ptoui> is not acceptable.
<bontres> is not acceptable.
<zoggax> is not acceptable.
<wiinq> is not acceptable.
<eep> is acceptable.
<houctuh> is acceptable.
#include<stdio.h>
#include<string.h> int yuanyin(char c)
{
if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u') return 1;
return 0;
} int is_yuanyin(char a[])
{
int i,len=strlen(a);
for( i=0; i<len; i++)
if( yuanyin(a[i]) )return 1;
return 0;
} int lianxu(char a[])
{
int i,len = strlen(a);
for(i=0;i<len;i++)
{
if ( i+2 < len && yuanyin(a[i]) && yuanyin(a[i+1]) && yuanyin(a[i+2]))
return 0;
if ( i+2 < len && !yuanyin(a[i]) && !yuanyin(a[i+1]) && !yuanyin(a[i+2]))
return 0;
}
return 1;
} int xiangtong(char a[])
{
int i, len=strlen(a);
for( i=0; i<len ; i++)
{
if(i+1<len && a[i]==a[i+1] && a[i]!='e' && a[i]!='o')
return 0;
}
return 1;
} int main()
{
char a[100];
int len,i;
while(scanf("%s",a)!=EOF){
if( strcmp(a,"end")==0) break;
if(is_yuanyin(a)&&lianxu(a)&&xiangtong(a))
printf("<%s> is acceptable.\n",a);
else
printf("<%s> is not acceptable.\n",a);
} }

  

1658: Easier Done Than Said?的更多相关文章

  1. HBase官方文档

    HBase官方文档 目录 序 1. 入门 1.1. 介绍 1.2. 快速开始 2. Apache HBase (TM)配置 2.1. 基础条件 2.2. HBase 运行模式: 独立和分布式 2.3. ...

  2. UVa(1658),Admiral,海军上将,拆点,MCMF

    题目链接:https://uva.onlinejudge.org/external/16/1658.pdf 题意:求1到N的两条路(不能相交),距离和最小. 分析: 第一次做拆点,有点意思.刚开始一直 ...

  3. OpenJudge/Poj 1658 Eva's Problem

    1.链接地址: http://bailian.openjudge.cn/practice/1658 http://poj.org/problem?id=1658 2.题目: 总时间限制: 1000ms ...

  4. hdu 1039 Easier Done Than Said? 字符串

    Easier Done Than Said?                                                                     Time Limi ...

  5. ural 1356. Something Easier(数论,哥德巴赫猜想)

    1356. Something Easier Time limit: 1.0 secondMemory limit: 64 MB “How do physicists define prime num ...

  6. (转)Is attacking machine learning easier than defending it?

    转自:http://www.cleverhans.io/security/privacy/ml/2017/02/15/why-attacking-machine-learning-is-easier- ...

  7. 遇到 ORACLE 错误 1658

    在对oracle导入数据时,多次报以下错误: IMP-00003: 遇到 ORACLE 错误 1659ORA-01659: 无法分配超出 1 的 MINEXTENTS (在表空间 ZSTA_DATA_ ...

  8. uva 1658 Admiral (最小费最大流)

    uva 1658 Admiral 题目大意:在图中找出两条没有交集的线路,要求这两条线路的费用最小. 解题思路:还是拆点建图的问题. 首先每一个点都要拆成两个点.比如a点拆成a->a'.起点和终 ...

  9. uva 1658 Admiral - 费用流

    vjudge传送门[here] 题目大意:给一个有(3≤v≤1000)个点e(3≤e≤10000)条边的有向加权图,求1~v的两条不相交(除了起点和终点外没有公共点)的路径,使权值和最小. 正解是吧2 ...

随机推荐

  1. UVa 1645 Count (递推,数论)

    题意:给定一棵 n 个结点的有根树,使得每个深度中所有结点的子结点数相同.求多棵这样的树. 析:首先这棵树是有根的,那么肯定有一个根结点,然后剩下的再看能不能再分成深度相同的子树,也就是说是不是它的约 ...

  2. CodeForces 382C【模拟】

    活生生打成了大模拟... #include <bits/stdc++.h> using namespace std; typedef long long LL; typedef unsig ...

  3. 洛谷 P4704 太极剑【贪心】

    首先考虑分割线能分割一条线当且仅当分割线一个端点在这条线的ab中间,另一端点在外面,也就是分割线对应的一条弧不能同时有这条线的两个端点 每条线的两端点都染同色,然后分段,一段里面颜色互不相同,分割线就 ...

  4. PHP实现用户登录页面

    PHP学习日常,放在上面记录一下咯 我用了bootstrap框架,这样的界面要好看一点 登录页面: 必须用户名.密码.验证码都输入正确才能登录成功喔,否则出现下面提示 登陆成功之后,登录和注册选项切换 ...

  5. github的上传本地文档

    自从使用github以来,一直都是在github网站在线上传文件到仓库中,但是有时因为网络或者电脑的原因上传失败.最重要的原因是我习惯本地编辑,完成以后再一起上传github.看过了几个教程,总结出最 ...

  6. CF446B DZY Loves Modification 【思维/优先队列】By cellur925

    题目传送门 题目大意:给一个 \(n*m\) 的矩阵,并进行 \(k\) 次操作,每次操作将矩阵的一行或一列的所有元素的值减 \(p\) ,得到的分数为这次修改之前这一列/一行的元素和,求分数最大值. ...

  7. [題解]luogu_P1144最短路計數

    1.無權圖最短路邊權為1 2.如果兩個點恰好不能被更新(d[y]==d[x]+1)那麼就能通過x的所有最短路到達y,所以ans[y]+=ans[x] 3.如果兩個點不能恰好被更新(d[y]>d[ ...

  8. scrapy框架中选择器的用法

    scrapy框架中选择器的用法 Scrapy提取数据有自己的一套机制,被称作选择器(selectors),通过特定的Xpath或者CSS表达式来选择HTML文件的某个部分Xpath是专门在XML文件中 ...

  9. UWP 基本控件

    -------持续更新 updated 2017.11.8---------------------- 一:TextBlock 文本显示框 1. IsTextSelectionEnabled属性  值 ...

  10. BZOJ1108(思路)

    题目本质:因为只能往南和往东走所以不管怎么组合方案结果都是一样的Orz……我太菜了想不到嘤嘤嘤 #pragma comment(linker, "/STACK:1024000000,1024 ...