题解 | #字符串分隔#

字符串分隔

https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7

#include <iostream>
using namespace std;

int main() {
    string s;
    cin >> s;
    while (s.size() % 8 != 0)
        s += "0";
    for (string::size_type i = 0; i != s.size(); ++i) {
        cout << s[i];
        if (i % 8 == 7)
            cout << endl;
    }
    return 0;
}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务