题解 | #字符串分隔#
字符串分隔
https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
#include <iostream>
using namespace std;
int main() {
string s;
while (getline(cin, s)) { // 注意 while 处理多个 case
int i = 0;
while (i < s.size()) {
for (int j = 0; j < 8; j++) {
if (i >= s.size()) {
cout << '0';
} else {
cout << s[i];
}
i++;
}
cout << endl;
}
}
}
// 64 位输出请用 printf("%lld")
携程成长空间 146人发布