题解 | #字符串分隔#
字符串分隔
https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
String st = sc.nextLine();
if(st.length()==0){
return;
}
while(st.length()%8 != 0){
st+="0";
}
while(st.length()/8 !=0){
System.out.println(st.substring(0,8));
st = st.substring(8);
}
}
}
public class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
String st = sc.nextLine();
if(st.length()==0){
return;
}
while(st.length()%8 != 0){
st+="0";
}
while(st.length()/8 !=0){
System.out.println(st.substring(0,8));
st = st.substring(8);
}
}
}