Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, count = 0;;
- cout << "Введите количество символов: " << endl;
- cin >> n;
- char s;
- cout << "Введите " << n << " символов:" << endl;
- for (int i =0 ; i < n; ++i){
- cin >> s;
- if (s == 'b') count++;
- }
- cout << "Буква b встречается " << count << " раз";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement