Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- #include <algorithm>
- using namespace std;
- int CountStartsWithA(const vector<string>& xs) {
- return count_if(xs.begin(), xs.end(), [](const string& str) {
- return (toupper(str[0]) == 'A');
- });
- }
- int main() {
- // не меняйте тело main
- cout << CountStartsWithA({ "And"s, "another"s, "one"s, "gone"s, "another"s,
- "one"s
- "bites"s,
- "the"s, "dust"s });
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement