Advertisement
kostes

Untitled

Mar 12th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. setlocale(0,"");
  9. string st;
  10. cout<<"введи строку - St"<<endl;
  11. getline(cin, st);
  12. int n = st.length();
  13. int k = 0;
  14. for (int i = 0; i < n; i++)
  15. {
  16. if (st[i]==' ' && i>0 && (st[i-1]=='a' || st[i-1]=='A'))
  17. k++;
  18.  
  19. }
  20. if(st[n-1]=='a' || st[n-1]=='A') k++;
  21. cout<<k<<" slov zakanch na a, A";
  22.  
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement