char * removeDuplicates(char * S){ int top=-1; int i; int len=strlen(S); for(i=0;i<len;i++){ S[++top]=S[i];//入栈 if(top>0&&S[top]==S[top-1]){ top=top-2; } } S[top+1]='