2008-01-04 12:45:46eva
Fri classwork
import java.util.*;
public class Ya
{
public static void main(String args[])
{
Scanner input = new Scanner(System.in);
Random r = new Random();
int array[][] = new int[10][10];
for (int i = 0; i <= 9; i++)
{
for (int k = 0; k <= 9; k++)
{
array[i][k] = r.nextInt(100) + 1;
}
}
for (int i=0; i<= 9 ; i++)
{
for (int k=0; k<=9; k++)
{
System.out.print(array[i][k] + ”t”);
}
System.out.println();
}
int i=0, k=0;
System.out.print(”輸入行”);
i = input.nextInt();
System.out.print(”輸入列”);
k = input.nextInt();
System.out.println(array[i][k]);
}
}
public class Ya
{
public static void main(String args[])
{
Scanner input = new Scanner(System.in);
Random r = new Random();
int array[][] = new int[10][10];
for (int i = 0; i <= 9; i++)
{
for (int k = 0; k <= 9; k++)
{
array[i][k] = r.nextInt(100) + 1;
}
}
for (int i=0; i<= 9 ; i++)
{
for (int k=0; k<=9; k++)
{
System.out.print(array[i][k] + ”t”);
}
System.out.println();
}
int i=0, k=0;
System.out.print(”輸入行”);
i = input.nextInt();
System.out.print(”輸入列”);
k = input.nextInt();
System.out.println(array[i][k]);
}
}