•长度不是8整数倍的字符串请在后面补数字0,空字符串不处理。
package niuke;
import java.util.Scanner;
public class Ceshi {
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
String str = scan.nextLine();
StringBuilder strBuilder = new StringBuilder(str);
if(strBuilder.length()%8!=0){
int m=8-strBuilder.length()%8;
for(int i=0;i<m;i++){
strBuilder.append("0");
}
}
while(strBuilder.length()!=0){
System.out.println(strBuilder.substring(0,8));
strBuilder = strBuilder.delete(0, 8);
}
}
}
}