HW6.8】的更多相关文章

import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the length of the list: "); int length = input.nextInt(); int[] list = new int[length]; fo…
public class Solution { public static void main(String[] args) { int count = 0; int[] card = new int[4]; int sum = 0; while(true) { sum = 0; for(int i = 0; i < 4; i++) card[i] = (int)(Math.random() * 13 + 1); count++; for(int i: card) sum += i; if(su…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); int[] number = new int[10]; System.out.print("Enter 10 numbers: "); for(int i = 0; i < 10; i++) number[i] = inp…
import java.util.Scanner; import java.util.Arrays; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter list1 length: "); int length1 = input.nextInt(); int[] list1 = ne…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter list1 length: "); int length1 = input.nextInt(); int[] list1 = new int[length1]; System.ou…
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter a, b, c: "); double[] equtation = new double[3]; double[] roots = new double[2]; for(int i…
public class Solution { public static void main(String[] args) { int count = 0; int color; int number; String colorStr; String numberStr; String[] colorSet = {" ", " ", " ", " "}; while(true) { color = (int)(Math.ra…
public class Solution { public static void main(String[] args) { boolean[] box = new boolean[101]; for(int i = 1; i <= 100; i++) { for(int j = i; j <= 100; j += i) changeBox(box, j); } for(int i = 1; i <= 100; i++) System.out.printf("%d\t%b\…
import java.util.Arrays; public class Solution { public static void main(String[] args) { int[][] chessboard = new int[8][8]; int[][] answerSave = new int[92][8]; int[] oneAnswer = new int[8]; while(true) { putQueens(chessboard); if(judgeCorrect(ches…
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 balls to drop: "); int numberOfBalls = input.nextInt(); System.out.print(&qu…