Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```c++
- #include <iostream>
- #include<fstream>
- #include <cstring>
- using namespace std;
- int main()
- {
- char s[101];
- cin.getline(s,101);
- int ok,cnt;
- for(int i=0; i<strlen(s) ;i++)
- {
- if(s[i]>='0' && s[i]<='9' && s[i-1]==' ')
- {
- ok=0;
- cnt=1;
- for(int j=i+1 ;s[j]!=' '; j++)
- {
- cnt++;
- if(s[j]=='.')
- ok=1;
- }
- if(ok==1)
- strcpy(s+i,s+i+cnt);
- }
- }
- cout<<s;
- return 0;
- }
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement