#include "stdafx.h"#include <algorithm>#define MAX_LENGTH 500void delDuplicate(char* pStr, int iStrlen){ int iLargeLabel = 0; int iSmallLabel = 0; int i0 = 0; int ikey; for(int i = 0; i < iStrlen; i++) { ikey = pStr[i] - 'A'; if(ikey < 26) { if( ((iLargeLabel >> ikey) & 1) == 0 ) { iLargeLabel += 1<<ikey; pStr[i0] = pStr[i]; i0++; } } else { ikey = pStr[i] - 'a'; if( ((iSmallLabel >> ikey) & 1) == 0 ) { iSmallLabel += 1<<ikey; pStr[i0] = pStr[i]; i0++; } } } pStr[i0] = pStr[iStrlen];}int main(){ char pStrInput[MAX_LENGTH]; scanf("%s", pStrInput); int iLen = 0; while(pStrInput[iLen++] != '\0') continue; iLen--; if(iLen == 0) printf("the string is empty\n"); else { delDuplicate(pStrInput, iLen); printf("the new string is %s\n", pStrInput); }}