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 s[256];
- cin.getline(s, 256);
- int len = strlen(s);
- for (int i = 0; i < len; i++)
- {
- if ( (s[i + 3] == ' ' || s[i+3]==NULL ) && (i==0 || s[i-1]==' '))
- {
- s[i]='*';
- strcpy(s+i+1, s+i+3);
- }
- }
- cout << s;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement