Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- class zahyou {
- public static void main(String[] args) throws IOException {
- BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
- String[][] retu = new String[5][5];
- int[] xretu = new int[3];
- int[] yretu = new int[3];
- int i = 0, j = 0;
- int cnt = 0;
- for (i = 0; i < 5; i++) {
- for (j = 0; j < 5; j++) {
- retu[i][j] = " ";
- }
- }
- for (cnt = 0; cnt < 3; cnt++) {
- System.out.print(cnt + 1 + "のX座標入力>");
- String strxretu = br.readLine();
- xretu[cnt] = Integer.parseInt(strxretu);
- System.out.print(cnt + 1 + "のY座標入力>");
- String stryretu = br.readLine();
- yretu[cnt] = Integer.parseInt(stryretu);
- retu[xretu[cnt]][yretu[cnt]] = "×";
- }
- System.out.println("座標算出");
- System.out.print(" 1 2 3 4 5 \n");
- for (i = 0; i < 5; i++) {
- System.out.print(i + 1);
- for (j = 0; j < 5; j++) {
- System.out.print(retu[i][j]);
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement