**#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <strings.h>
void zip(char str1[],char str2[]);
int main()
{
char str1[20];
char str2[40];
gets(str1);
zip(str1,str2);
printf("%s\n",str2);
return 0;
}
void zip(char str1[],char str2[])
{
char *p=str1;
char *q=str2;
int t;
while(*p)
{
if(p>=‘1’&&p<=‘9’)
{
t=(p-‘0’)-1;
q++=(p-1);
while(t–)
{
q++=(p-1);
}
p++;
}
else p++;
}
q=’\0’;
}
解压字符串 例如: a3b4c5 解压为 aaabbbbccccc
最新推荐文章于 2022-10-03 20:16:04 发布