您的位置:首页 > 运维架构

topcode SRM 577 DIV2 EllysNewNickname

2013-04-28 19:00 405 查看
#include <iostream>
#include <vector>
#include <string>

using namespace std;

const string vowels = "aeiouy";

bool  isVowels(char ch){
for(int i = 0; i <  vowels.length(); i ++ )
if( vowels[i] == ch) return true;
return false;
}

class EllysNewNickname{
public:
int getLength(string nickname){
int cnt = 1;
for(int i = 1; i < nickname.length(); i ++ ){
if( isVowels(nickname[i]) && isVowels(nickname[i-1]) ) continue;
cnt++;
}
return cnt;
}
};


  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: