Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <Windows.h>
- using namespace std;
- const int BUFSIZE = 256;
- char buf[BUFSIZE];
- int main()
- {
- setlocale(LC_ALL, "Russian");
- int n, i, N, b=0;
- char w = 'б';
- char W = 'Б';
- cout << "Введите длину строки ";
- cin >> N; { char *s = new char[N];
- cout << "Введи строку текста \n ";
- cin.get();
- cin.getline(s, N);
- n = strlen(s);
- for (i = 0; i < n; i++)
- if (s[i] == ' ')
- {
- if ( int(s[i+1]) == int(W)) b++;
- if ( int(s[i+1]) == int(w)) b++;
- }
- cout << "Кол-во слов на букву Б - " << b << "\n"; }
- return (0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement