题解 | #字符串分隔#
字符串分隔
http://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include<string.h> int main() { char arr[100]; while (~scanf("%s", arr)) { int len = strlen(arr); int i = 0; for (i = 0; i < len; i++) { printf("%c", arr[i]); if (i % 8 == 7) printf("\n"); } if (len % 8 != 0) { for (i = len % 8; i < 8; i++) { printf("0"); } } } return 0; }