Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- setlocale(0,"");
- string st;
- cout<<"введи строку - St"<<endl;
- getline(cin, st);
- int n = st.length();
- int k = 0;
- for (int i = 0; i < n; i++)
- {
- if (st[i]==' ' && i>0 && (st[i-1]=='a' || st[i-1]=='A'))
- k++;
- }
- if(st[n-1]=='a' || st[n-1]=='A') k++;
- cout<<k<<" slov zakanch na a, A";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement