Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- using namespace std;
- int main()
- {
- char st[100];
- int k=0,i=0;
- cout<<"Vvedite stroky: ";
- cin.getline(st, 100);
- for(i=strlen(st);i>-1;i--)
- {
- if (st[i]==' ')
- if(st[--i]=='g')
- k++;
- }
- cout<<"Kolichestvo slov s 'g' in the end :" <<k<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement