2080 - P396 7

通过次数

0

提交次数

0

时间限制 : 1 秒 内存限制 : 128 MB

P396 7

题目输入

a line


题目输出

occurences of character e

输入/输出样例

输入格式

feedback is a proper method.

输出格式

4

C++解答

#include<iostream>
#include<string>

using namespace std;

int main()
{
	string sentence;
    int length,count=0;
	char word;

	getline(cin,sentence);
    length=sentence.length ();

	for (int i=0;i<length;++i)
	{
		word=sentence[i];
		if(word=='e') count++;
	}

	cout<<count<<endl;
}