Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Щеглов В.А. 19ВИ1
- #include <iostream>
- using namespace std;
- int kol_3a(char* s)
- {
- int i,b,kol,k;
- char c=' ';
- char d='А';
- k=sizeof(s);
- for(i=0;i<k;i++)
- {
- if(s[i]==c)
- {
- if(b==3) kol++;
- b=0;
- } else
- {
- if(s[i]==d) b++;
- }
- }
- return kol;
- }
- int main()
- {
- setlocale(LC_ALL, "Russian");
- char s[128];
- cout<<"Введите строку состоящую из заглавных русских букв и пробелов: ";
- cin.getline(s,128);
- cout<<"Кол-во слов с 3-мя буквами А="<<kol_3a(s);
- return 0;
- }
Add Comment
Please, Sign In to add comment