国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Java > 正文

HDU 2052 JAVA

2019-11-06 07:21:19
字體:
供稿:網(wǎng)友

Give you the width and height of the rectangle,darw it.

Input Input contains a number of test cases.For each case ,there are two numbers n and m (0 < n,m < 75)indicate the width and height of the rectangle.Iuput ends of EOF.

Output For each case,you should draw a rectangle with the width and height giving in the input. after each case, you should a blank line.

Sample Input 3 2

Sample Output +—+ | | | | +—+

import java.util.*;class Main{ public static void main(String args[]){ Scanner sc=new Scanner(System.in); while(sc.hasNext()){ int n=sc.nextInt();// 寬,行, int m=sc.nextInt();// 長,豎 S(n);Y(n,m);S(n); System.out.PRintln(); } } public static void S(int n){ System.out.print("+"); for(int i=0;i<n;i++){ System.out.print("-"); } System.out.println("+"); } public static void Y(int n,int m){ for(int j=0;j<m;j++){ System.out.print("|"); for(int i=0;i<n;i++){ System.out.print(" "); } System.out.println("|"); } }}
上一篇:HDU 2053 JAVA

下一篇:HDU 2051 JAVA

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 屏东县| 嘉兴市| 罗平县| 桐城市| 馆陶县| 咸丰县| 鄂托克旗| 临澧县| 金秀| 杭锦旗| 德清县| 武鸣县| 永德县| 息烽县| 新巴尔虎右旗| 芒康县| 曲水县| 巴楚县| 新巴尔虎左旗| 法库县| 蒙山县| 五华县| 永善县| 正定县| 南城县| 桐庐县| 和静县| 珠海市| 莱阳市| 衡阳市| 大洼县| 永胜县| 乐山市| 赫章县| 吴忠市| 小金县| 屏东市| 常德市| 舞钢市| 合阳县| 古交市|