话不多说,看代码:
#include <stdio.h> #include <stdlib.h> int main(void) { char s1[180] = "a-z0-9hahah-a-z-s-d"; char s2[180]; expand(s1, s2); printf("Now the s2 is : %s", s2); return 0; } void expand(char * s1, char * s2) { int i = 0, j = 0, c; while((c = s1[i++]) != '