题解 | #字符串分隔#
字符串分隔
https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
#include <iostream> #include <string> #include<vector> using namespace std; int main() { string s; int t=0; getline(cin,s); for( int i=0;i<s.size();i++){ cout<<s[i]; t++; if(t==8){ cout<<endl; t=0; } } if(t==0){ return 0; } else{ while(t<8){ cout<<0; t++; } } } // 64 位输出请用 printf("%lld")