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