Advertisement
aimon1337

Untitled

Jun 21st, 2022
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. ```c++
  2. #include <iostream>
  3. #include<fstream>
  4. #include <cstring>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. char s[101];
  10. cin.getline(s,101);
  11. int ok,cnt;
  12.  
  13. for(int i=0; i<strlen(s) ;i++)
  14. {
  15. if(s[i]>='0' && s[i]<='9' && s[i-1]==' ')
  16. {
  17. ok=0;
  18. cnt=1;
  19. for(int j=i+1 ;s[j]!=' '; j++)
  20. {
  21. cnt++;
  22. if(s[j]=='.')
  23. ok=1;
  24. }
  25.  
  26. if(ok==1)
  27. strcpy(s+i,s+i+cnt);
  28. }
  29. }
  30.  
  31.  
  32.  
  33. cout<<s;
  34.  
  35.  
  36. return 0;
  37. }
  38. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement