标签:orm rand job ble cep format strcmp rds sts
Problem Description
#include <iostream> #include <algorithm> #include <stdio.h> #include <cstdlib> #include <cstring> #include <cmath> #include <ctime> #include <ctype.h> using namespace std; int judge(char a) { if(a==‘a‘||a==‘e‘||a==‘i‘||a==‘o‘||a==‘u‘) return 1; return 0; } int main() { char word[20]; while(scanf("%s",word)!=EOF&&strcmp(word,"end")) { int l=strlen(word),i,flag=0; for(i=0;i<l;i++) { if(judge(word[i])) flag=1; } if(flag==1) { for(i=0;i<l-1;i++) { if(word[i]==word[i+1]&&word[i]!=‘e‘&&word[i]!=‘o‘) { flag=2; } } if(flag==2) printf("<%s> is not acceptable.\n",word); else { for(i=0;i<l-2;i++) { if((judge(word[i])&&judge(word[i+1])&&judge(word[i+2]))||(!judge(word[i])&&!judge(word[i+1])&&!judge(word[i+2]))) { flag=3; } } if(flag==3) printf("<%s> is not acceptable.\n",word); else printf("<%s> is acceptable.\n",word); } } else printf("<%s> is not acceptable.\n",word); } return 0; }
HDU1039 Easier Done Than Said?
标签:orm rand job ble cep format strcmp rds sts
原文地址:http://www.cnblogs.com/gonsedup/p/7262271.html