HW7.3】的更多相关文章

public class Solution { public static void main(String[] args) { int[][] m = {{1, 2}, {3, 4}, {5, 6}, {7, 8}, {9, 10}}; shuffle(m); for(int i = 0; i < m.length; i++) { for(int j = 0; j < m[0].length; j++) System.out.print(m[i][j] + " "); S…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); int n = input.nextInt(); int limit = input.nextInt(); int[][] borrowers = new int[n][n]; for(int i = 0; i < n; i++) { b…
import java.util.Arrays; public class Solution { public static void main(String[] args) { int row = (int)(Math.random() * 10); int column = (int)(Math.random() * 10); int[][] array = new int[row][column]; for(int i = 0; i < row; i++) { for(int j = 0;…
public class Solution { public static void main(String[] args) { double[][] set1 = {{1, 1}, {2, 2}, {3, 3}, {4, 4}}; double[][] set2 = {{0, 1}, {1, 2}, {4, 5}, {5, 6}}; double[][] set3 = {{0, 1}, {1, 2}, {4, 5}, {4.5, 4}}; System.out.println(isOnOneL…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the size for the matrix: "); int size = input.nextInt(); input.close(); int[][] array = ne…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the number of rows and columns of the array: "); int row = input.nextInt(); int column = i…
import java.util.Scanner; public class Solution { public static void main(String[] args) { double[] rates = {0.10, 0.15, 0.25, 0.28, 0.33, 0.35}; int[][] brackets = { {8350, 33950, 82250, 171550, 372950}, {16700, 67900, 137050, 208850, 372950}, {8350…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter a number between 0 and 511: "); int number = input.nextInt(); input.close(); char[] chArra…
public class Solution { public static void main(String[] args) { int[][] array = new int[3][3]; for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { array[i][j] = (int)(Math.random() * 2); System.out.print(array[i][j] + " "); } System…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); char[][] chessboard = new char[7][7]; int x, y; for(int i = 0; i < 7; i++) for(int j = 0; j < 7; j++) chessboard[i][j]…