题解 | 字符串分隔
字符串分隔
https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String s = scanner.nextLine();
int len = s.length();
int i = 0;
while(i < len){
System.out.print(s.charAt(i));
i++;
if(i > 7 && i % 8 == 0){
System.out.println();
}
}
while(i % 8 != 0){
System.out.print(0);
i++;
}
}
}


查看11道真题和解析