Advertisement
cd62131

zahyo

Apr 9th, 2014
417
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 1.05 KB | None | 0 0
  1. import java.io.*;
  2.  
  3. class zahyou {
  4.   public static void main(String[] args) throws IOException {
  5.     BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  6.     String[][] retu = new String[5][5];
  7.     int[] xretu = new int[3];
  8.     int[] yretu = new int[3];
  9.     int i = 0, j = 0;
  10.     int cnt = 0;
  11.     for (i = 0; i < 5; i++) {
  12.       for (j = 0; j < 5; j++) {
  13.         retu[i][j] = " ";
  14.       }
  15.     }
  16.     for (cnt = 0; cnt < 3; cnt++) {
  17.       System.out.print(cnt + 1 + "のX座標入力>");
  18.       String strxretu = br.readLine();
  19.       xretu[cnt] = Integer.parseInt(strxretu);
  20.       System.out.print(cnt + 1 + "のY座標入力>");
  21.       String stryretu = br.readLine();
  22.       yretu[cnt] = Integer.parseInt(stryretu);
  23.       retu[xretu[cnt]][yretu[cnt]] = "×";
  24.     }
  25.     System.out.println("座標算出");
  26.     System.out.print(" 1 2 3 4 5 \n");
  27.     for (i = 0; i < 5; i++) {
  28.       System.out.print(i + 1);
  29.       for (j = 0; j < 5; j++) {
  30.         System.out.print(retu[i][j]);
  31.       }
  32.       System.out.println();
  33.     }
  34.   }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement