import java
.util
.Scanner
;
public class S7_11 {
static int n
;
static char[] rec
;
public static void main(String
[] args
) {
Scanner sc
= new Scanner(System
.in
);
n
= sc
.nextInt();
sc
.nextLine();
String str
= sc
.nextLine();
int tem
= (n
- (str
.length() % n
))%n
;
for (int i
= 0; i
< tem
; i
++) {
str
+= " ";
}
rec
= str
.toCharArray();
f();
}
static void f() {
int col
= rec
.length
/ n
;
int start
= (col
- 1) * n
;
for (int i
= 0; i
< n
; i
++) {
for (int j
= 0; j
< col
; j
++) {
System
.out
.print(rec
[start
- j
* n
]);
}
start
++;
if (i
!= n
-1)System
.out
.println();
}
}
}
#include<iostream>
#include<string>
using namespace std
;
char arr
[1005][105];
int main(){
string str
;
int n
,lie
,count
=0;
int len
;
cin
>>n
;
getchar();
getline(cin
,str
);
len
=str
.length();
if(str
.length()%n
==0){
lie
=str
.length()/n
;
}
else lie
=str
.length()/n
+1;
for(int j
=lie
-1;j
>=0;j
--){
for(int i
=0;i
<n
;i
++){
if(count
==len
){
arr
[i
][j
]=' ';
}
else arr
[i
][j
]=str
[count
++];
}
}
for(int i
=0;i
<n
;i
++){
for(int j
=0;j
<lie
;j
++){
cout
<<arr
[i
][j
];
}
if(i
!=n
-1){
cout
<<endl
;
}
}
return 0;
}
转载请注明原文地址: https://win8.8miu.com/read-11387.html