题解 | #字符串分隔#
字符串分隔
https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
#include <iostream> #include <string> using namespace std; int main() { string str; while(cin >> str) { size_t c=0; size_t len = str.length(); size_t i=0; while(i<len) { cout<<str[i]; c++; if(c%8==0){ cout<<endl; c=0; } i++; } while(c&&c<8) { cout<<'0'; c++; } cout<<endl; } }