题解 | #字符串分隔#
字符串分隔
http://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
String str = scan.nextLine();
StringBuffer sb = new StringBuffer(str);
int len = 8 - sb.length() % 8;
if(len != 8){
for(int i = 0; i < len; i++){
sb.append('0');
}
}
for(int i = 0; i < sb.length(); i += 8){
System.out.println(sb.substring(i, i + 8));
}
}
}