`
lylegend13
  • 浏览: 82785 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论
文章列表
//A1.java import java.math.BigInteger; public class A1 { private final static int N = 100; public static void main(String[] args) { System.out.println(N + "!=" + exec(N)); System.out.println("长度=" + String.valueOf(exec(N)).length()); } public static BigIn ...
//A1.java public class A1 { public static void main(String[] args) { exec(2, 'A', 'C'); } public static void exec(int n, char from, char to) { if (n == 1) { print(from, to); } else { char free = (char) ('A' + 'B' + 'C' - from - to); exec(n - 1, from, free); print ...
// A2.java public class A2 { private final static int N = 6; public static void main(String[] args) { // 第一维:1到N // 第二维:方向,0向左,1向右 int a[][] = new int[N][2]; createArray(a); System.out.println("1:"); printArray(a); System.out.println("\n"); ...
// A2.java public class A2 { public static void main(String[] args) { exec(1000); } public static void exec(int N) { int a[] = new int[N + 1]; int s; for (int i = 2; i <= N; i++) { // 标记过的不再操作 if (a[i] == 1) { continue; } // 对未标记的数的所有倍数标记 s = i; ...
//A1.java public class A1 { final static int N = 1000;// 数组长度 final static int m = 10;// 待查找的1串的长度 private static int amount1 = 0; private static int amount2 = 0; public static void main(String[] args) { int a[] = new int[N]; makeArray(a); printArray(a); System.out.prin ...
//A.java public class A { public static void main(String[] args) { for (int i = 2; i < 10000; i++) { if (isPerfect(i)) { System.out.print(i + " = "); exec(i); } } } public static boolean isPerfect(int n) { if (n == sum(n)) { return true; } ...
//A.java public class A { public static void main(String[] args) { int a=55,b=10; int result=exec(a,b); System.out.println(result); } private static int exec(int a,int b){ if(a<b){ return exec(b,a); } if(a%b!=0){ return exec(b,a%b); } return b; } } ...
// B.java public class B { // 人的编号:1~N public static void main(String[] args) { exec(10, 3); } // N:人的数量 // num:报数时喊到即出列的数 static void exec(int N, int num) { int b[] = new int[N]; int i = -1; int count = 0; while (Left(b) != 0) { if (count == num) { // 出列的人标 ...
//A.java public class A { final static int N = 10; public static void main(String[] args) { byte a[][] = new byte[(int) Math.pow(2, N)][N]; for (int i = 1; i < a.length; i++) { for(int j=0;j<N;j++){ a[i][j]=a[i-1][j]; } a[i]=exec(a[i], N); } for (int ...
//A.java public class A { final static int N = 10; public static void main(String[] args) { StringBuffer str = new StringBuffer(); for (int i = 0; i < N; i++) { str.append("0"); } System.out.println(str); for (int i = 0; i < Math.pow(2, N)-1; i++) { S ...
//A.java public class A { final static int N=10; public static void main(String[] args) { int count = 0; byte a[][] = exec(N); for (int i = 0; i < a.length; i++) { System.out.print(count++ + ":"); for (int j = 0; j < a[0].length; j++) { if (a[i][j] == ...
//A.java public class A { public static void main(String[] args) { int a = 1234567890; System.out.println(last(exec(a))); } //独立数值+位数 public static String exec(int num) { String r = ""; String n = String.valueOf(num); for (int i = 0; i < n.length(); i++) ...
  //A.java import java.util.ArrayList; public class A { public static void main(String[] args) { String str = "he吉llo林yu大r学i"; exec(str,5); } public static void exec(String str,int N){ ArrayList<String> result = new ArrayList<String>(); int i = 0; / ...
Global site tag (gtag.js) - Google Analytics