fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int n=0;
  7. char a[100];
  8. cin>>a;
  9. for(int i=1;a[i]!='\0';i++){
  10. if(a[i]==a[i-1])
  11. a[i-1]='\0';
  12. n++;
  13. }
  14. for(int i=0;i<=n;i++){
  15. if(a[i]=='\0'){
  16. i++;
  17. }
  18. cout<<a[i];
  19. }
  20. return 0;
  21. }
Success #stdin #stdout 0s 4308KB
stdin
ccoooding
stdout
coding