#include <iostream>
#include <string>
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
string s = "Onetwothree";
int lc = count_if(s.begin(), s.end(), islower);
int uc = count_if(s.begin(), s.end(), isupper);
cout << uc << " " << lc << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCXN0cmluZyBzID0gIk9uZXR3b3RocmVlIjsKCWludCBsYyA9IGNvdW50X2lmKHMuYmVnaW4oKSwgcy5lbmQoKSwgaXNsb3dlcik7CglpbnQgdWMgPSBjb3VudF9pZihzLmJlZ2luKCksIHMuZW5kKCksIGlzdXBwZXIpOwoJY291dCA8PCB1YyA8PCAiICIgPDwgbGMgPDwgZW5kbDsKCXJldHVybiAwOwp9
prog.cpp: In function 'int main()':
prog.cpp:9:47: error: no matching function for call to 'count_if(std::basic_string<char>::iterator, std::basic_string<char>::iterator, <unresolved overloaded function type>)'
int lc = count_if(s.begin(), s.end(), islower);
^
In file included from /usr/include/c++/5/algorithm:62:0,
from prog.cpp:3:
/usr/include/c++/5/bits/stl_algo.h:3982:5: note: candidate: template<class _IIter, class _Predicate> typename std::iterator_traits<_Iterator>::difference_type std::count_if(_IIter, _IIter, _Predicate)
count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)
^
/usr/include/c++/5/bits/stl_algo.h:3982:5: note: template argument deduction/substitution failed:
prog.cpp:9:47: note: couldn't deduce template parameter '_Predicate'
int lc = count_if(s.begin(), s.end(), islower);
^
prog.cpp:10:47: error: no matching function for call to 'count_if(std::basic_string<char>::iterator, std::basic_string<char>::iterator, <unresolved overloaded function type>)'
int uc = count_if(s.begin(), s.end(), isupper);
^
In file included from /usr/include/c++/5/algorithm:62:0,
from prog.cpp:3:
/usr/include/c++/5/bits/stl_algo.h:3982:5: note: candidate: template<class _IIter, class _Predicate> typename std::iterator_traits<_Iterator>::difference_type std::count_if(_IIter, _IIter, _Predicate)
count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)
^
/usr/include/c++/5/bits/stl_algo.h:3982:5: note: template argument deduction/substitution failed:
prog.cpp:10:47: note: couldn't deduce template parameter '_Predicate'
int uc = count_if(s.begin(), s.end(), isupper);
^