去除字符串中重复出现的字符
来源:互联网 发布:json接口api 编辑:程序博客网 时间:2024/05/16 01:40
/*****************************************************copyright (C), 2016-2017, Lighting Studio. Co., Ltd. Author ChenYangYang Date: 2016/12/19Description:去除字符串中重复出现的字符*****************************************************/#include <stdio.h>#include <string.h>#include <stdlib.h>#define MAX_SIZE 1024void removestr(char *str,char *dest){ int i; int j; int k = 0; int flag; int len; /*入口参数检查*/ if(str == NULL || dest == NULL) { exit(0); } len = strlen(str); for(i = 0; i < len; i++) { flag = 1; for(j = 0; j < i; j++) { if(dest[j] == str[i]) flag = 0; } if(flag) dest[k++] = str[i]; } dest[k] = '\0';}int main(){ char str[MAX_SIZE]; char dest[MAX_SIZE] = {"0"}; printf("input str is:"); scanf("%s",str); removestr(str,dest); printf("str = %s\n",str); printf("redest = %s\n",dest); return 0;}
0 0
- 去除字符串中重复出现的字符
- Java去除字符串中重复出现的字符
- 1.3 去除字符串中重复的字符
- 去除字符串中重复的字符
- 0056 去除字符串中重复的字符
- 去除一个字符串中出现的重复字符,并计算出出现最多次的字符的出现次数
- 去除字符串中重复字符
- 去除字符串中重复字符
- 给定一个字符串,去除整个字符串中重复的字符
- 寻找字符串中重复出现的字符
- 去除一个字符串中重复字符的方法
- 3.去除字符串中重复字符,保证每个字符只出现一次
- SQL 字符串中去除出现汉字之后的字符
- C# 去除字符串里的重复字符
- 给定字符串,要求除去字符串中重复出现的字符
- 去除给定字符串中重复的字符串
- java获取字符串中重复出现的字符
- java统计字符串中重复出现字符的个数
- SAPUI5 (01) - OpenUI5环境搭建
- win7 64位旗舰版系统耳机或音箱没有声音的解决方法
- 指针数组和数组指针
- Remove Linked List Elements
- ReactiveCocoa
- 去除字符串中重复出现的字符
- 【LeetCode-414】Third Maximum Number(C++)
- 2016-java基础篇-jdbc
- Filter基本案例(二)
- FAT32 R0.12b f_mkfs应用实例
- bzoj2599: [IOI2011]Race
- 学习python的第四十一天-第四章 python数据结构
- 小白学习无人机(三)
- 堆和栈的区别