/*
循环(统计两个连续的字母出现的次数)
编写一个程序读取输入,直到 '\n' ,并报告序列 ei 出现的次数
*/
#include <stdio.h>
#include <string.h>
int main(int argc, const char * argv[]) {
char str[80];
int count = 0;
gets(str);
int lenth = (int)strlen(str);
int i;
for (i = 0; i < lenth - 1; i++) {
if (str[i] == 'e' && str[i+1] == 'i') {
count++;
}
}
printf("count = %d\n",count);
return 0;
}