题解 | #字符串分隔#

字符串分隔

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

include

include

using namespace std;
int main()
{
string str;
int len,temp,j;
while(cin>>str)
{
len=str.size();
temp=0;
while(len>8)
{
for(j=temp;j<temp+8;j++)
cout<<str[j];
len=len-8;
temp=temp+8;
cout<<endl;
}
for(j=temp;str[j]!='\0';j++)
cout<<str[j];
for(j=0;j<8-len;j++)
cout<<"0";
cout<<endl;
}
return 0;
}

全部评论

相关推荐

面了100年面试不知...:今年白菜这么多,冬天可以狂吃了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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