package cWeb.buleCup;
import java.util.Scanner;
public class C1115 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
int N = in.nextInt();
while(N!=0) {
int a = in.nextInt();
int b = in.nextInt();
for (int i = 1; i <= (a+1)/2; i++) {
//打印前面空格
for (int j = 1; j <= i-1; j++) {
System.out.print(" ");
}
if(i!=((a+1)/2)) {
System.out.print("X");
for (int j = 1; j <=-2*(i-1)+a-2; j++) {
System.out.print(" ");
}
System.out.print("X");
System.out.println();
}else {
System.out.print("X");
System.out.println();
}
}
for (int i = 1; i <=a-((a+1)/2); i++) {
for (int j = 1; j <= a-((a+1)/2)-i; j++) {
System.out.print(" ");
}
System.out.print("X");
for (int j = 1; j <=2*i-1 ; j++) {
System.out.print(" ");
}
System.out.print("X");
System.out.println();
}
while((b-1)!=0) {
for (int i = 2; i <= (a+1)/2; i++) {
//打印前面空格
for (int j = 1; j <= i-1; j++) {
System.out.print(" ");
}
if(i!=((a+1)/2)) {
System.out.print("X");
for (int j = 1; j <=-2*(i-1)+a-2; j++) {
System.out.print(" ");
}
System.out.print("X");
System.out.println();
}else {
System.out.print("X");
System.out.println();
}
}
for (int i = 1; i <=a-((a+1)/2); i++) {
for (int j = 1; j <= a-((a+1)/2)-i; j++) {
System.out.print(" ");
}
System.out.print("X");
for (int j = 1; j <=2*i-1 ; j++) {
System.out.print(" ");
}
System.out.print("X");
System.out.println();
}
b--;
}
System.out.println();
N--;
}
}
}
问题 1115: DNA
最新推荐文章于 2024-07-23 10:13:43 发布