游客 Signup | Login
中文 | En

1885 - 【C语言训练】数字母

输入一个字符串,数出其中的字母的个数.

Input

一个字符串,不包含空格(长度小于100)

Output

字符串中的字母的个数

Examples

Input

124lfdk54AIEJ92854&%$GJ

Output

10

Solution C++

#include<iostream>
#include<string>
#include<cctype>
using namespace std;
int main()
{
	string s;
	getline(cin,s);
	int len=s.size(),ans=0;
	for (int i=0; i<len; i++)
		if (isalpha(s[i])) ans++;
	cout<<ans<<endl;
	return 0;
}
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题