Hdu-Easier Done Than Said-1039

Source: Internet
Author: User
Easier Done Than Said?

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission (s): 5875 Accepted Submission (s): 2934


Problem DescriptionPassword 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, before t 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 using common/pronounceable words that are not acceptable.


InputThe 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.


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


Sample Input

atvptouibontreszoggaxwiinqeephouctuhend
 


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. # Include <stdio. h> # include <string. h> # include <stdlib. h> const int MAX = 200; char str [MAX]; //Global variable, must be put in frontInt len; bool isyuanyin (char c) {if (c = 'A' | c = 'E' | c = 'I' | c = 'U' | c = 'o ') return true; elsereturn false;} bool judge1 (int n) {for (int I = 0; I <n; I ++) {if (isyuanyin (str [I]) return true;} return false;} bool judge2 (int n) {for (int I = 2; I <n; I ++) {if (isyuanyin (str [I-2]) & isyuanyin (str [I-1]) & isyuanyin (str [I]) {return false;} if (! Isyuanyin (str [I-2]) &! Isyuanyin (str [I-1]) &! Isyuanyin (str [I]) {return false ;}} bool judge3 (int n) {for (int I = 1; I <n; I ++) {if (str [I] = str [I-1] & str [I]! = 'E' & str [I]! = 'O') {return false ;}} return true ;}int main () {while (scanf ("% s", & str )! = EOF) {if (strcmp (str, "end") = 0) {break;} len = strlen (str); if (judge1 (len) = false) {printf ("<% s> is not acceptable. \ n ", str); continue;} if (judge2 (len) = false) {printf (" <% s> is not acceptable. \ n ", str); continue;} if (judge3 (len) = false) {printf (" <% s> is not acceptable. \ n ", str); continue;} printf (" <% s> is not acceptable. \ n ", str);} return 0 ;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.