Guest User

Untitled

a guest
Mar 21st, 2015
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <Windows.h>
  4. using namespace std;
  5.  
  6. const int BUFSIZE = 256;
  7. char buf[BUFSIZE];
  8.  
  9. int main()
  10. {
  11. setlocale(LC_ALL, "Russian");
  12. int n, i, N, b=0;
  13. cout << "Введите длину строки ";
  14. cin >> N; { char *s = new char[N];
  15. cout << "Введи строку текста \n ";
  16. cin.get();
  17. cin.getline(s, N);
  18. n = strlen(s);
  19. for (i = 0; i < n; i++)
  20. if (s[i] == ' ')
  21. {
  22. if ( s[i+1] == 'Б') b++;
  23. if ( s[i+1] == 'б') b++;
  24. }
  25. cout << "Кол-во слов на букву Б - " << b << "\n"; }
  26. return (0);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment