java£ºµÝ¹é£º10ԪǮ°´1£¬2£¬5ÔªÈÎÒâ×éºÏ
package game;
public class Money {
public static void main(String[] args) {
fun("", 10);
System.out.println("×ܹ²Ëã·¨£º" + i);
}
// 10ԪǮµÄ×é³É£¬1£¬2£¬5ÈÎÒâ×éºÏ
public static int i = 1;
public static void fun(String log, int n) {
// int num = n;
if (0 == n) {
System.out.println(log.substring(0, log.length() - 1) + "=");
return;
} else if (1 == n) {
System.out.println(log + "1" + "=");
return;
}
if (n >= 1)
fun(log + "1+", n - 1);
if (n >= 2)
fun(log + "2+", n - 2);
if (n >= 5)
fun(log + "5+", n - 5);
i++;
}
}
Ïà¹ØÎĵµ£º
¼øÓÚÍøÉÏËѵ½µÄ¶¼ÊÇ»ùÓÚjdk1.4»òÒÔǰ°æ±¾£¬¶øÇÒ±¾µØ¿âÓõÄÊÇCÓïÑÔ¡£¶øÏÖÔÚÊÇ»ùÓÚC++£¬ËùÒÔ¸üмǼÈçÏ£º
µÚÒ»²½£º´´½¨JavaÔ´ÂëÎļþ
public class Hello{
static{
System.loa ......
Ò»£ºÒª½â¾öµÄÎÊÌâ
ÎÒÃÇÔÚ³¢ÏÊ JDK1.5 µÄʱºò£¬ÏàÐŲ»ÉÙÈËÓöµ½¹ý Unsupported major.minor version 49.0
´íÎ󣬵±Ê±¶¨»áãȻ²»ÖªËù´ë¡£ÒòΪ¸Õ¿ªÊ¼ÄÇ»á¶ù£¬ÍøÉÏÓë´ËÏà¹ØµÄÖÐÎÄ×ÊÁÏ»¹²»¶à£¬ÏÖÔÚºÃÁË£¬ÍøÉÏÒ»ÕÒ¾ÍÖªµÀÊÇÈçºÎ½â¾ö£¬´ó¶à»á¸æËßÄãҪʹÓà JDK
1.4 ÖØÐ±àÒë¡£ÄÇôÖÁÓÚΪʲô£ ......
package arrays.compara;
/**
*
* @author Happy ¶þ·Ö²éÕÒ·¨
*/
public class BinarySearch {
public static void main(String[] args) {
int[] arrInt = { 2, 34, 32, 24, 23, 34, 12, 3, 4, 2 };
int index = bSearch(29, arrInt, 0, arrInt.length);
& ......
package arrays.file;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
i ......
package collection;
public class Student {
public Student() {}
public Student(String name, String sex, int age) {
this.name = name;
this.sex = sex;
this.age = age;
}
@Override
public String toString() {
......