unsigned int str_num(char *str[], int num[], int len){
int i, j; int count; int flag[len];
for (i = 0; i < len; i++) {
num[i] = 0; flag[i] = 0; }
for (i = 0; i < len; i ++) {
for (j = 0; j <= len; j ++) {
if((0 == flag[i])&& (0 == strncmp(str[j], str[i],
strlen(str[j]) > strlen(str[i]) ? strlen(str[j]) : strlen(str[i])))) {
num[i] ++; flag[i] = 1; } } }}
利⽤⼀个数组,记录每个字符串的个数,另⼀个flag数组标记已经计数过的字符串
因篇幅问题不能全部显示,请点此查看更多更全内容