- 浏览: 82785 次
- 性别:
- 来自: 武汉
最新评论
-
yuanliangding:
有没有办法改呢。
使用反射修改final属性 -
风雪木易:
a并没有改变,用a.getter访问,别用field.get( ...
使用反射修改final属性 -
lylegend13:
哈包祥明 写道可以问一下 这篇文章要说明什么》》???
AC ...
1012 -
哈包祥明:
可以问一下 这篇文章要说明什么》》???
1012 -
gengu:
你写代码注释都不带的??
KMP
文章列表
//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 ...
- 2009-11-22 00:52
- 浏览 1596
- 评论(3)
//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 ...
- 2009-11-21 23:58
- 浏览 852
- 评论(0)
// 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 ...
- 2009-11-18 00:31
- 浏览 971
- 评论(0)
//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;
}
...
- 2009-11-15 17:34
- 浏览 953
- 评论(0)
//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) {
// 出列的人标 ...
- 2009-11-14 00:54
- 浏览 1457
- 评论(1)
//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 ...
- 2009-11-12 18:54
- 浏览 1092
- 评论(0)
//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 ...
- 2009-11-12 13:59
- 浏览 874
- 评论(0)
//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] == ...
- 2009-11-12 10:08
- 浏览 901
- 评论(0)
//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++) ...
- 2009-11-08 19:38
- 浏览 1480
- 评论(0)
//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; / ...
- 2009-11-08 18:58
- 浏览 1363
- 评论(0)