//
// main.cpp
// ex10_6
//
// Created by a007 on 17/12/2.
// Copyright © 2017年 a007. All rights reserved.
//
#include <iostream>
#include <string>
#include <cctype>
using namespace std;
int countLetters(const string &s){
int count = 0;
for (auto character : s) {
if (isalpha(character)) { //如果是字母
count++;
}
}
return count;
}
int main(int argc, const char * argv[]) {
string s;
cout << "Enter a string: ";
getline(cin, s);
cout << "The number of letters in \"" << s << "\" is "
<< countLetters(s) << endl;
return 0;
}