Rectangle
来源:互联网 发布:网络歌曲大全100首一 编辑:程序博客网 时间:2024/06/05 11:00
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Rectangle {
public static void main(String[] args) throws FileNotFoundException { // TODO Auto-generated method stub Scanner sc = new Scanner(new File("src/file/rectangle")); int T = sc.nextInt(); int[][] rect = new int[50][50]; for (int i = 0; i < 50; i++) { for (int j = 0; j < 50; j++) { rect[i][j] = 0; } } for (int t = 1; t <= T; t++) { int x = sc.nextInt(), y = sc.nextInt(); int h = sc.nextInt(), w = sc.nextInt(); int xt = x + h - 1, yt = y + w - 1; for (int i = 0; i < h; i++) { rect[x + i][y] = 1; rect[xt - i][yt] = 1; } for (int i = 0; i < w; i++) { rect[x][y + i] = 1; rect[xt][yt - i] = 1; } } for (int i = 0; i < 50; i++) { for (int j = 0; j < 50; j++) { if (rect[i][j] == 0) System.out.print(" "); else System.out.print(rect[i][j] + " "); } System.out.println(); }}
}
0 0
- Rectangle
- Rectangle
- Rectangle
- rectangle
- Rectangle
- Rectangle
- rectangle
- Rectangle
- Rectangle VC
- word rectangle
- draw rectangle
- Maximal Rectangle
- Maximal Rectangle
- GDI -Rectangle
- Maximal Rectangle
- Maximal Rectangle
- Maximal Rectangle
- Maximal Rectangle
- 十大最值得关注的国内大数据分析厂商
- Android 自定义view——签名板
- datalist模板
- MyEclipse中Ctrl+Alt+向下方向键变成旋转屏幕解决方法
- kafka官方Introduction翻译
- Rectangle
- Android拔出U盘后app出现crash
- 升级或降级Cocoapods
- WTL CListViewCtrl 实现列表元素字体着色
- fastboot及lk解析
- php 通过get方式传递json
- 加载自定义属性实现app换肤功能
- iOS: 如何获取ios设备的当前IP地址
- 关于String与Integer类型比较问题