易截截图软件、单文件、免安装、纯绿色、仅160KB

java:递归:10的阶乘

package game;
public class JieCeng {
 public static void main(String[] args){
  System.out.println(fun(10));
 }
 
 public static int fun(int n){
  if(1==n)
   return 1;
  System.out.println( n * fun(n-1));
  return n * fun(n-1);
 }
}


相关文档:

中国公历算法&中国农历算法(JAVA)

中国公历算法不是太难,关键是星期值的确定。这里给出了简单算法: 
public static int dayOfWeek(int y, int m, int d) {
int w = 1; // 公历一年一月一日是星期一,所以起始值为星期日
y = (y-1)%400 + 1; //&n ......

java:double类型截取俩位小数,不取舍,

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.##"). ......

java:手写二叉树BinaryTree添加和查询方法

package arrays.myArray;
public class BinaryTree {
 private Node root;
 // 添加数据
 public void add(int data) {
  // 递归调用
  if (null == root)
   root = new Node(data, null, null);
  else
   addTree(root, data);
......

java:三种经典大排序汇总,冒泡,插入,选择

package arrays.myArray;
public class SortArr {
 public static void main(String[] args) {
  int[] arrInt = { 4, 7, 8, 5, 6, 3, 2, 3, 4 };
  maoPaoSort(arrInt);
  print("冒泡排序:", arrInt);
  arrInt = new int[]{ 4, 7, 8, 5, 6, 3, 2, 3, 4 };
 & ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号