1 #include<stdio.h> 2 #include<string.h> 3 4 char*CompressStr(char s[]){ 5 6 char t[255]; 7 int i = 0,j,k = 0; 8 9 while( s[i] ){ 10 11 j = i+1; 12 13 while(s[i] == s[j]) 14 ++j; 15 16 t[k++] = j-i+'0'; 17 t[k++] = s[i]; 18 i=j; 19 20 } 21 22 t[k]='
1 #include<stdio.h> 2 #include<string.h> 3 4 char*CompressStr(char s[]){ 5 6 char t[255]; 7 int i = 0,j,k = 0; 8 9 while( s[i] ){ 10 11 j = i+1; 12 13 while(s[i] == s[j]) 14 ++j; 15 16 t[k++] = j-i+'0'; 17 t[k++] = s[i]; 18 i=j; 19 20 } 21 22 t[k]='