char* ord_alphlong(char *s)
{
int start = 0, idx = 0;
char *words[fstrlen(s) / 2 + 1];
for (int i = 0; s[i]; i++)
{
if (!fis(s[i]) && i > 0 && fis(s[i - 1]))
start = i;
if (fis(s[i]) && i > 0 && !fis(s[i - 1]))
words[idx++] = fstrsub(s, start, i);
if (!s[i + 1] && !fis(s[i]))
words[idx++] = fstrsub(s, start, i + 1);
}
fsort(words, idx, &cmp_alpha);
fsort(words, idx, &cmp_len);
char* res = malloc(100);
int pushed=0;
for (int i = 0; i < idx - 1; i++)
{
res[pushed]=*words[i];
if (fstrlen(&res[pushed]) < fstrlen(&res[pushed + 1]))
{
res[pushed]=res[94];
}
else
{
res[pushed]=res[32];
}
pushed++;
}
res[pushed]='\0';
return res;
}
char* ord_alphlong(char *s)
{
int start = 0, idx = 0;
char *words=malloc(fstrlen(s) / 2 + 1);
for (int i = 0; s[i]; i++)
{
if (!fis(s[i]) && i > 0 && fis(s[i - 1]))
start = i;
if (fis(s[i]) && i > 0 && !fis(s[i - 1]))
words[idx++] = *fstrsub(s, start, i);
if (!s[i + 1] && !fis(s[i]))
words[idx++] = *fstrsub(s, start, i + 1);
}
fsort(&words, idx, &cmp_alpha);
fsort(&words, idx, &cmp_len);
for (int i = 0; i < idx - 1; i++)
{
words[i]=words[i];
if (fstrlen(&words[i]) < fstrlen(&words[i + 1]))
words[i]=words[94];
else
words[i]=words[32];
}
return &words[idx - 1];
}
char* ord_alphlong(char *s)
{
int start = 0, idx = 0;
char *words[fstrlen(s) / 2 + 1];
for (int i = 0; s[i]; i++)
{
if (!fis(s[i]) && i > 0 && fis(s[i - 1]))
start = i;
if (fis(s[i]) && i > 0 && !fis(s[i - 1]))
words[idx++] = fstrsub(s, start, i);
if (!s[i + 1] && !fis(s[i]))
words[idx++] = fstrsub(s, start, i + 1);
}
fsort(words, idx, &cmp_alpha);
fsort(words, idx, &cmp_len);
for (int i = 0; i < idx - 1; i++)
{
words[i];
if (fstrlen(words[i]) < fstrlen(words[i + 1]))
words[i]=words[94];
else
words[i]=words[32];
}
return (words[idx - 1]);
}