例えば1,a,b,t,3,55,g,99,g,f,e,v,b,r,f,5と入力すると
1 a b t
3 55 g 99
g f e v
b r f 5 と表示されるといった形です。
import java.util.Scanner;
class Sample2{
public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); int [][]x; x = new int[4][4]; System.out.print("0~100の数値かアルファベット入力"); int x = stdIn.nextInt(); for (int i = 0; i <= 3; i++){ for(int j = 0; j <=3; j++) System.out.println(x); } }
}
あなたの回答
tips
プレビュー