题解 | #字符串分隔#
字符串分隔
http://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()){
String a = sc.nextLine().trim();
while (a.length() <= 8) {
if (a.length() < 8) {
a += "0";
} else {
System.out.println(a);
break;
}
}
if (a.length() > 8) {
process(a);
}
}
}
public static void process(String a) {
if (a.length() > 8) {
System.out.println(a.substring(0,8));
process(a.substring(8, a.length()));
} else {
while (a.length() <= 8) {
if (a.length() < 8) {
a += "0";
} else {
System.out.println(a);
break;
}
}
}
}
}