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++;
}
}
Ïà¹ØÎĵµ£º
Ϊʲô˵ÂÒÂëÊÇÖйú³ÌÐòÔ±ÎÞ·¨±ÜÃâµÄ»°ÌâÄØ£¿Õâ¸öÊ×ÏÈÒª´Ó±àÂë»úÖÆÉÏ˵Æð£¬´ó¼Ò¶¼ÊÇÖÐÎĺÍÓ¢ÎĵıàÂë¸ñʽ²»ÊÇÒ»Ñù£¬½âÂëÒ²ÊDz»Ò»ÑùµÄ£¡Èç¹ûÖйúµÄ³ÌÐòÔ±²»»áÓöµ½ÂÒÂ룬ÄÇôֻÓÐʹÓúºÓï±à³Ì¡£ººÓï±à³ÌÊÇÔõô»ØÊÂÎÒÒ²²»´óÇå³þ£¬Ó¦¸ÃÊÇǰÄê°É£¬ÎÒÒ»ÅóÓѸøÎÒ½éÉܺºÓï±à³Ì£¬Ôõô²»´í²»´í£¿µ±Ê±ÒòΪѧϰæûȥ¹Ø×¢Õâ¸ö£¬µÈÎÒÏÐ ......
Ò»£ºÒª½â¾öµÄÎÊÌâ
ÎÒÃÇÔÚ³¢ÏÊ JDK1.5 µÄʱºò£¬ÏàÐŲ»ÉÙÈËÓöµ½¹ý Unsupported major.minor version 49.0
´íÎ󣬵±Ê±¶¨»áãȻ²»ÖªËù´ë¡£ÒòΪ¸Õ¿ªÊ¼ÄÇ»á¶ù£¬ÍøÉÏÓë´ËÏà¹ØµÄÖÐÎÄ×ÊÁÏ»¹²»¶à£¬ÏÖÔÚºÃÁË£¬ÍøÉÏÒ»ÕÒ¾ÍÖªµÀÊÇÈçºÎ½â¾ö£¬´ó¶à»á¸æËßÄãҪʹÓà JDK
1.4 ÖØÐ±àÒë¡£ÄÇôÖÁÓÚΪʲô£ ......
public class Split{
public static void main(String[] args){
double pai = 3.14159;
findTwo(pai);
public static void findTwo(double value){
System.out.println(new DecimalFormat("0.##"). ......
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 collection;
import java.util.*;
public class NewSet {
public static void main(String[] args) {
Set<Student> students = new HashSet<Student>();
for (int i = 0; i < 6; i++) {
students.add(new Student("Happy"+i,"male"+i,20+i)) ......