这道题也比较简单,写三个函数判断三个条件即可.....

但是开始时我按照已经注释掉的提交,居然提示WA,我百思不得其解,后改成上面的判断式就可以了,求高手解答....

 #include "iostream"

 using namespace std;

 #define Max 21
int Function1(char *p,int len);
int Function2(char *p,int len);
int Function3(char *p,int len);
int vowel(char p);
int main(void)
{
char letters[Max];
int len;
int condition_1=,condition_2=,condition_3=;
while(cin>>letters)
{
if(!strcmp(letters,"end"))
break;
len=strlen(letters);
condition_1=Function1(letters,len);
condition_2=Function2(letters,len);
condition_3=Function3(letters,len);
if(condition_1&&condition_2&&condition_3)
cout<<"<"<<letters<<">"<<" is acceptable."<<endl;
else
cout<<"<"<<letters<<">"<<" is not acceptable."<<endl;
/* if(condition_1==1)
{
condition_2=Function2(letters,len);
if(condition_2==1)
{
condition_3=Function3(letters,len);
if(condition_3==1)
cout<<"<"<<letters<<">"<<" is acceptable."<<endl;
else cout<<"<"<<letters<<">"<<" is not acceptable."<<endl;
}
else cout<<"<"<<letters<<">"<<" is not acceptable."<<endl;
}
else cout<<"<"<<letters<<">"<<" is not acceptable."<<endl;*/
}
return ;
} int Function1(char *p,int len)
{
for(int i=;i<len;i++)
{
if(p[i]=='a'||p[i]=='e'||p[i]=='i'||p[i]=='o'||p[i]=='u')
return ;
}
return ;
}
int Function2(char *p,int len)
{
for(int i=;i<len;i++)
{
if(((i+)<len)&&(vowel(p[i]))&&(vowel(p[i+]))&&(vowel(p[i+])))
return ;
else if(((i+)<len)&&(!vowel(p[i]))&&(!vowel(p[i+]))&&(!vowel(p[i+])))
return ;
}
return ;
}
int Function3(char *p,int len)
{
char flag;
for(int i=;i<len;i++)
{
flag=p[i];
if(((i+)<len)&&(p[i+]==flag)&&(flag!='e')&&(flag!='o'))
return ;
}
return ;
} int vowel(char p)
{
if(p=='a'||p=='e'||p=='i'||p=='o'||p=='u')
return ;
else return ;
}

杭电acm 1039题的更多相关文章

  1. 杭电acm 1076题

    水题,一个求闰年的题目,复习一下闰年的求法.... 1,如果能被4整除但不能被100整除的是闰年 2,能被400整除的是闰年 题目大意是:给定一个开始年份T以及一个正数N,要求求出从T开始,到了哪一年 ...

  2. 杭电acm 1037题

    本题应该是迄今为止最为简单的一道题,只有一组输入,输出也简单.... /****************************************** 杭电acm 1037题 已AC ***** ...

  3. 杭电acm 1038题

    本题比较简单,但是需要掌握几个小技巧,先上代码 /************************************* 杭电ACM 1038题,已AC ********************* ...

  4. 杭电acm 1049题

    一道水题..... 大意是一条1inch的虫子在一个n inch的盒子的底部,有足够的能够每一分钟往上爬u inch,但是需要休息一分钟,这期间会往下掉d inch,虫子爬到盒子口即认为结束.要求计算 ...

  5. 杭电acm 1033题

    Problem Description For products that are wrapped in small packings it is necessary that the sheet o ...

  6. 杭电ACM刷题(1):1002,A + B Problem II 标签: acmc语言 2017-05-07 15:35 139人阅读 评

    最近忙于考试复习,没有多少可供自己安排的时间,所以我利用复习之余的空闲时间去刷刷杭电acm的题目,也当对自己编程能力的锻炼吧. Problem Description I have a very si ...

  7. 杭电acm刷题顺序

    最近兴趣来了,闲暇之余,回顾大学期间刷过的杭电acm那些入门级别的题,以此巩固基础知识! 以下参考刷题顺序,避免入坑 原文传送门:https://blog.csdn.net/liuqiyao_01/a ...

  8. 杭电acm 1015题

    马上要找工作了,锻炼下自己的写程序能力,不多说,上代码 /********************杭电acm 1015 已AC 在这个程序里,使用穷举法来实现,但是输出顺序需要安装字典的最大 来输出 ...

  9. 杭电acm 1040题

    本题是一个非常简单的升序排序题目,但那时在做的时候把题目看错了,导致花费了大量的时间来检查为什么WA,最后发现题目看错了..... /********************************* ...

随机推荐

  1. es6语法入门let 和 const 命令

    let块级作用域 { let a = 10; var b = 1; } a // ReferenceError: a is not defined. b for循环的计数器,就很合适使用let命令(防 ...

  2. hadoop_异常_02_ExitCodeException exitCode=1: chmod: changing permissions of `/ray/hadoop/dfs/data': Operation not permitted

    一.异常现象 启动hadoop时,datanode启动失败,出现如下异常: 2018-03-23 14:39:09,962 WARN org.apache.hadoop.hdfs.server.dat ...

  3. @angular/cli项目构建--http(2)

    客户端GET设置参数查询: search() { const params = new HttpParams() .set('userName', this.userName) .set('fullN ...

  4. middle school

    One of the most difficult transitions faced by parents and youth is that of going from elementary to ...

  5. Project://STARK

    数据添加&编辑 删除&分页 搜索框功能 action批量操作 filter多条件过滤 pop_up弹窗

  6. 在装有windows跟ubuntu的机器上重新安装windows后修复ubuntu的grub

    本文只对没有单独用类似easyBCD这种软件单独设立启动分区的双系统,在重新安装win7之后,因为win7覆盖了ubuntu的grub,导致ubuntu无法启动的问题. (1)不管使用什么方法,首先需 ...

  7. 运行flask程序

    Command Line Interface Installing Flask installs the flask script, a Click command line interface, i ...

  8. Azure ASM到ARM迁移 (三) Reserved IP的迁移

    Azure的ASM下,很多用户的应用种域名的解析在DNS服务器种都采用A记录的方式,所以很多用户都在Azure上采用了Reserved IP. 关于Reserved IP,可以参考http://www ...

  9. Oracle RMAN 学习:恢复

    Oracle RMAN 学习:恢复 6 rman恢复 Rman中的恢复对应restore,recover Restore,数据修复,利用备份集的数据文件来替换已损坏的数据文件或将其恢复到另外一个位置, ...

  10. HAproxy+Mycat

    haproxy+mycat搭建haproxy server 10.0.1.134mycat server 10.0.1.134,10.0.1.135mysql master 10.0.1.134mys ...