题解 | #字符串分隔#把合适个数的 0 加上然后 8 个 8 个输出。

字符串分隔

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

#include<iostream>
#include<cstring>
#include<cstdio>
#include<map>
#include<set>
#include<stack>
#include<vector>
#include<algorithm>
#include<cmath>
#include<fstream>
#include<iomanip>
#include<queue>
#include<list>
#include<cctype>

#define ___ "-------------------------------\n"

using namespace std;
typedef long long ll;
typedef unsigned long long ull; 
const ll maxn = 100000 + 5;
int main(){
//	ios::sync_with_stdio(false);
//	ifstream cin("data.txt");
//	freopen("data.txt", "r", stdin);
    string s;
    getline(cin, s);
    s += string(8 - ((s.length() % 8) ? (s.length() % 8) : 8), '0');
    for(int i = 1; i <= s.length();i++){
        cout << s[i - 1];
        if(!(i % 8))cout << "\n";
    }
	return 0;
}
全部评论

相关推荐

一天代码十万三:这个学历有中大厂实习也是0面,没办法,斩杀线是这样的
点赞 评论 收藏
分享
09-29 16:59
已编辑
门头沟学院 Java
牛客96609213...:疯狂背刺,之前还明确设置截止日期,还有笔试,现在一帮人卡在复筛,他反而一边开启扩招,还给扩招的免笔试,真服了,你好歹先把复筛中的给处理了再说
投递大疆等公司10个岗位
点赞 评论 收藏
分享
10-09 16:12
门头沟学院 Java
帅宇殿下:佬,简历写的什么
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务