题解 | #c#实现方式
字符串分隔
http://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
#include <stdio.h> #include <string.h> int main(void) { unsigned int i, j = 0; char str[1000] = "\0"; char *pRch = str; scanf("%s", str); j = strlen(str); while (1) { if (j > 8) { for (i = 0; i < 8; i++) { printf("%c", *pRch); pRch++; } j -= 8; printf("\n"); } else { for (i = 0; i < j; i++) { printf("%c", *pRch); pRch++; } j = 8 - j; for (i = 0; i < j; i++) { printf("%c", '0'); } return 0; } } }