fjnu 1322 Easier Done Than Said?

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.
KEY:这个题只要把握那三个规则,把三个规则作为上个条件,就很简单了;
 
 
Source:

#include
< iostream >
using   namespace  std;

int  isVowel( char  c)
{
    
if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'return 1;
    
return 0;
}


int  Ruel_1( char  str[])
{
    
int len=strlen(str);
    
for(int i=0;i<len;i++)
        
if(isVowel(str[i])) return 1;
    
return 0;
}


int  Ruel_2( char  str[])
{
    
int len=strlen(str);
    
for(int i=0;i<len-2;i++)
    
{
        
if(isVowel(str[i])&&isVowel(str[i+1])&&isVowel(str[i+2])) return 0;
        
if(!isVowel(str[i])&&!isVowel(str[i+1])&&!isVowel(str[i+2])) return 0;
    }

    
return 1;
}


int  Ruel_3( char  str[])
{
    
int len=strlen(str);
    
for(int i=0;i<len-1;i++)
    
{
        
if(str[i]==str[i+1])
        
{
            
if(str[i]=='e'||str[i]=='o'continue;
            
else return 0;
        }

    }

    
return 1;
}


void  output( char  str[], int  a, int  b, int  c)
{
    
if(a&&b&&c)
        cout
<<"<"<<str<<"> is acceptable."<<endl;
    
else cout<<"<"<<str<<"> is not acceptable."<<endl;
}



int  main()
{
//    freopen("fjnu_1322.in","r",stdin);
    char str[25];
    cin
>>str;
    
int a,b,c;
    
while(strcmp(str,"end"))
    
{
        a
=Ruel_1(str);
        b
=Ruel_2(str);
        c
=Ruel_3(str);
        output(str,a,b,c);
        cin
>>str;
    }

    
return 0;
}




    



 
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好,以下是一个简单的使用HTML制作类似于"https://www.fjnu.edu.cn/main.htm"网页的示例代码: ```html <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>福建师范大学</title> </head> <body> <header> <h1>福建师范大学</h1> </header> <nav> <ul> <li><a href="#">首页</a></li> <li><a href="#">学校概况</a></li> <li><a href="#">新闻中心</a></li> <li><a href="#">招生就业</a></li> <li><a href="#">校园生活</a></li> <li><a href="#">教学科研</a></li> <li><a href="#">校友服务</a></li> </ul> </nav> <main> <article> <h2>学校简介</h2> <p>福建师范大学创建于1907年,是福建省人民政府与教育部共建高校。学校主要办学特色是师范教育和人文社会科学,具有百年办学历史和深厚的文化底蕴。</p> </article> <section> <h2>新闻动态</h2> <ul> <li><a href="#">福建师范大学2021年迎新工作启动</a></li> <li><a href="#">2021年福建师范大学教师招聘公告</a></li> <li><a href="#">福建师范大学2021年本科招生计划</a></li> </ul> </section> </main> <aside> <h2>联系我们</h2> <p>地址:福建省福州市闽侯县上街镇</p> <p>电话:0591-83442777</p> <p>邮箱:fjnu@fjnu.edu.cn</p> </aside> <footer> <p>© 2021 福建师范大学</p> </footer> </body> </html> ``` 在这个示例中,我们使用HTML5标记语言来创建网页。我们通过`<header>`元素来定义网页的标题,通过`<nav>`元素来定义网页的主要导航,通过`<main>`元素来定义网页的主要内容,通过`<aside>`元素来定义网页的侧边栏内容,通过`<footer>`元素来定义网页的页脚。在`<main>`元素中,我们使用`<article>`元素来定义学校简介部分的内容,使用`<section>`元素来定义新闻动态部分的内容。网页的样式和布局可以通过CSS来实现。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值