Guest User

Untitled

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