题解 | #字符串分隔#
字符串分隔
https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
#include <iostream> using namespace std; int main() { const int N = 8; string s; getline (cin, s); int len = s.size(); if (!len) return 0; for (int i = 0; i < len; i += N){ if (i + N > len) s.append(N - len + i, '0'); cout << s.substr(i, N) << endl; } return 0; } // 64 位输出请用 printf("%lld")