题解 | 字符串分隔
字符串分隔
https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
#include <iostream>
#include <string>
using namespace std;
inline void print(char ch){
printf("%c",ch);
}
int main() {
string str;
cin >> str;
int len = str.size();
while(len % 8 != 0){
str += '0';
len++;
}
print(str[0]);
for(int idx = 1; idx < len; ++idx){
if(idx % 8 == 0)
print('\n');
print(str[idx]);
}
return 0;
}
// 64 位输出请用 printf("%lld")
