import java.util.Scanner;publicclassMain{publicstaticvoidmain(String[] args){
Scanner sc=newScanner(System.in);
String s = sc.nextLine();
String str = sc.nextLine();
int n = Integer.parseInt(s);//行数
char []ch = str.toCharArray();
int m = str.length();//字符长度
int l =0;//列数if(m%n ==0){
l = m/n;}else{
l =(int)(m/n)+1;}
int sum = l*n;
char []ch1 =newchar[sum];for(int i =0;i<sum;i++){if(i<m){
ch1[i]=ch[i];}else{
ch1[i]=' ';}}for(int i =0;i<n;i++){
int u = sum-n+i;for(int j=0;j<l;j++){
System.out.print(ch1[u-j*n]);}if(i<n-1){
System.out.println();}}}}
B站解析视频b站视频解析-古风排版代码部分import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner sc= new Scanner(System.in); String s = sc.nextLine(); String str = sc.nextLine(); int n = Integer.pa.