Advertisement
SelinD

76

Jun 28th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstring>
  3. #include<fstream>
  4. using namespace std;
  5. ifstream fin("cux.txt");
  6. char s[101];
  7. int main()
  8. {
  9. int i;
  10. cin.getline(s,101);
  11. for(i=0;i<strlen(s);i++)
  12. {
  13. if(s[i]==s[i+1])
  14. {
  15. while(s[i]==s[i+1])
  16. {
  17. strcpy(s+i,s+i+1);
  18. }
  19. strcpy(s+i,s+i+1);
  20. i=-1;
  21. }
  22. }
  23. cout<<s;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement