public class Test21 { public static void main(String[] args) { // TODO Auto-generated method stub int sum = 0; int[] array = new int[sum]; int index=0; for (int i = 1; i < 100; i++) { if (i % 3…
public class Test19 { public static void main(String[] args) { // TODO Auto-generated method stub // 矩形图案 for (int i = 0; i < 4; i++) { for (int j = 0; j < 10; j++) { if (j == 0 || j == 9 || i == 0 |…
public class Test16 { public static void main(String[] args) { // TODO Auto-generated method stub int sum = 0; for (int i = 1; i <= 9; i++) { for (int j = 1; j <= i; j++) { sum=i*j; …
public int binarySearch(int[] data,int aim){//以int数组为例,aim为需要查找的数 int start = 0; int end = data.length-1; int mid = (start+end)/2;//a while(data[mid]!=aim&&end>start){//如果data[mid]等于aim则死循环,所以排除 if(data[mid]>aim){ end = mid-1; }else if(data[…
import java.util.Scanner;public class Test_while { public static void main(String[] args) { // TODO Auto-generated method stub Scanner input=new Scanner(System.in); /*int sum=0; int score=0; int c…
import java.util.Scanner;public class threeTest { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("请输入第一条边:"); int a = input.nextInt(); System.out.println("请…
import java.util.Scanner;public class Test15 { public static void main(String[] args) { // TODO Auto-generated method stub for (int i = 0; i < 1000; i++) { if (i % 3 == 0) { System.out.print(i+&quo…
import java.util.Scanner;public class Test13 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner input = new Scanner(System.in); int number = 0; do{ System.out.printl…