#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char s[1000000]; while(gets(s)!=NULL) { int len=strlen(s); int i; for(i=0;i<len;i++) { if(s[i]!=s[i+1]) { printf("%c",s[i]); } } printf("\n"); } return 0; } |
Double click to view unformatted code.