![](https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif)
#include<stdio.h>
void expand(char s1[],char s2[])
{
int i,j;
char c;
i=j=0;
while((c=s1[i++])!='\0')
{
if(s1[i]=='-' && c<s1[i+1])
{
i++;
while(c < s1[i])
{
s2[j++]=c++;
}
}
else
s2[j++]=c;
}
s2[j]='\0';
}
main()
{
char s1[]="0-zd-l";
char s2[100];
expand(s1,s2);
printf("s1=%s\ns2=%s\n",s1,s2);
}