HJ4题解 | #字符串分隔#
字符串分隔
https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
#include <iostream> #include <string> using namespace std; int main() { string input; getline(cin, input); while (input.size() >= 8) { cout << input.substr(0, 8) << endl; input = input.substr(8); } if (input.empty()) { return 0; } else { int zeroNum = 8 - input.size(); cout << input + string(zeroNum, '0'); } } // 64 位输出请用 printf("%lld")#刷题记录#