Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int countChar(const std::string &s) {
- struct ischar {
- ischar() {};
- ischar(unsigned char x) : x(x) {}
- bool operator()(unsigned char y) const {
- if (std::isalpha(y))
- return true;
- else
- return false;
- }
- private:
- unsigned char x;
- };
- ischar kat;
- return count_if(s.begin(), s.end(), kat);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement