例如這段代碼能實現開始輸入一個n,接下來有n行,
那我如何實現例如第一行有一個n,接下來有n組數據,例如
2
123
12
1
152
17
4
類似於這種格式的如何寫
/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner in = new Scanner(System.in);
int n = in.nextInt();
in.nextLine();
int[][] data = new int[n][];
for (int i = 0; i < n; i++)
{
String[] a = in.nextLine().split(" ");
data[i] = new int[a.length];
for (int j = 0; j < a.length; j++)
data[i][j] = Integer.parseInt(a[j]);
}
}
}