解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int h = sc.nextInt(); int w = sc.nextInt(); if(h <= 0 || w <= 0) return ; for(int i=0;i<h;i++) { for(int j=0;j<w;j++) { System.out.print("+-"); } System.out.printf("+\n"); System.out.println("| | |"); } for(int j=0;j<w;j++) { System.out.print("+-"); } System.out.printf("+"); } }
0.0分
1 人评分
简单的a+b (C语言代码)浏览:548 |
P1002 (C语言代码)浏览:980 |
剪刀石头布 (C语言代码)不知道怎么直接在scanf中用枚举变量浏览:1317 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:968 |
1009题解浏览:752 |
C语言程序设计教程(第三版)课后习题10.5 (C语言代码)浏览:956 |
拆分位数 (C语言代码)浏览:522 |
C语言程序设计教程(第三版)课后习题10.2 (C语言代码)浏览:538 |
C语言程序设计教程(第三版)课后习题1.6 (C语言代码)浏览:722 |
三角形 (C语言代码)浏览:659 |