Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main ()
  5. {
  6. char stringa[100];
  7. int i, l, m;
  8.  
  9. printf("Inserire una stringa:\n");
  10. gets(stringa);
  11.  
  12. l=strlen(stringa);
  13.  
  14. for(i=0; i<l; i++)
  15.  
  16. {
  17. if(stringa[i]==stringa[i+1])
  18.  
  19. {
  20. for(m=i; m<l; m++)
  21. stringa[m]=stringa[m+1];
  22. }
  23. }
  24.  
  25. printf("La stringa senza ripetizioni consecutive e %s", stringa);
  26.  
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement