#include<iostream>
#include <string>
using namespace std ;
int count(string Str) //统计字符串个数的函数
{
int i = 0, cnt = 0;
for (i=0; i<Str.length(); i++)
{
if (Str[i]>='a' && Str[i]<='z' || Str[i] >='A' && Str[i]<='Z' )
cnt++;
}
cout<<"your str:"<<endl; //展示输入内容
cout << "str="<<Str<<endl ;
return cnt;
}
void main()
{
string Str;
char ch;
cout<<"input str:"<<endl; //输入
getline(cin , Str );
int a = count(Str);
cout << "字母个数:" <<a<<endl;
}