解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class T1537 { public static void main(String[] args) { Scanner in = new Scanner(System.in); while(in.hasNext()){ int n = in.nextInt(),m = in.nextInt(); if(n == 0 || m == 0) continue; for(int i = 0;i<2*n+1;i++){ if(i%2 == 0) for(int j = 0;j<2*m+1;j++){ if(j%2 == 0) System.out.print("+"); else System.out.print("-"); if(j == 2*m) System.out.println(); } else for(int j = 0;j<2*m+1;j++){ if(j%2 == 0) System.out.print("|"); else System.out.print(" "); if(j == 2*m) System.out.println(); } } } in.close(); } }
0.0分
0 人评分