摘要:
递归算法计算阶乘import java.util.Scanner;public class DiGui { static long fact(int n) { if(n<=1) return 1; else return n*fact(n-1); } public static void... 阅读全文
posted @ 2015-04-29 15:44
Mathematics
阅读(255)
评论(0)
推荐(0)
摘要:
import java.util.Scanner;public class DiTui { public static int fibonacci(int n){ int t1,t2; if(n==1||n==2) { return 1; } else { t1 = fibona... 阅读全文
posted @ 2015-04-29 15:21
Mathematics
阅读(237)
评论(0)
推荐(0)
摘要:
穷举法求解鸡兔同笼问题//穷举法求解鸡兔同笼问题import java.util.Scanner;public class QiongJu { static int chicken,habbit; public static int qiongJu(int head,int foot){ int ... 阅读全文
posted @ 2015-04-29 13:28
Mathematics
阅读(273)
评论(0)
推荐(0)
摘要:
1.队列定义static final int QUEUELEN=15;class DATA3{ String name; int age;}class SQType{ DATA3[] data = new DATA3[QUEUELEN]; int head; int t... 阅读全文
posted @ 2015-04-29 11:18
Mathematics
阅读(161)
评论(0)
推荐(0)
摘要:
1.栈的定义static final int MAXLEN=50;class DATA2{ String name; int age;}class StackType{ static final int MAXLEN=50; DATA2[] data = new DATA2[... 阅读全文
posted @ 2015-04-29 10:36
Mathematics
阅读(131)
评论(0)
推荐(0)
浙公网安备 33010602011771号