去掉字符串中重复的字符-创新互联
#include
#include
using namespace std;
char *deletechar(char*inputstr,char *outputstr)
{
char *deststr=outputstr;
bool table[26]={false};
int k=0;
for (int i=0;i { char c=inputstr[i]; if (table[c-'a']==false) { outputstr[k++]=c; table[c-'a']=true; } } outputstr[k]=''; return deststr; } void main() { char str1[]="aaaabdcadjoiufdjouj"; char *deststr=new char[strlen(str1)+1]; memset(deststr,0,strlen(str1)+1); cout< }
网站标题:去掉字符串中重复的字符-创新互联
文章网址:http://myzitong.com/article/djgsoo.html