字符串分割--华为机试C语言解法
字符串分隔
http://www.nowcoder.com/questionTerminal/d9162298cb5a437aad722fccccaae8a7
#include<stdio.h> #include<string.h> int main(){ int lc1; char c1[101] = {0}; char *p = c1; for(int tmp =0;tmp<2;tmp++) { scanf("%s",&c1); lc1=strlen(c1); for(int i = lc1; i>0;) { char tmp[9]={'0','0','0','0','0','0','0','0','\0'}; if(i<=8) { memcpy(tmp, p, i); i=0; p = c1; } else { i-=8; memcpy(tmp, p, 8); p+=8; } printf("%s\n",tmp); } } return 0; }