题解 | #字符串分隔#
字符串分隔
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;
}
