1、单纯用数组来解题
思路:从左往右循环,每次碰到一个字符就和左边的字符串比较,如果有相同的就右移,如果没有找到相同的就从这个位置向右统计个数并输出。
1 #include<stdio.h> 2 3 void calCount(char arr[]) 4 { 5 int i,j,count,had; 6 i = j = count = had = 0; 7 while(arr[i] != '