用java写 一列数的规则如下:1、1、2、3、5、8、13、21、34...... 求第30位
摘要:public static void main(String[] args){ int a=1; int b=1; int temp; for (int i = 1; i <=30; i++) { System.out.println("第"+i+"位数"+a); temp=a+b; a=b; ...
阅读全文
插入法排序
摘要:/** 插入法排序 * @param args */ public static void main(String[] args) { int [] array={12,45,78,99,13,56}; System.out.print(Arrays.toString(insertSort(arra
阅读全文
二叉树算法
摘要:* 二叉树算法类 * @author Administrator * */public class Text { int date; //根节点数据 Text left; //左子树 Text rigth;//右子树 //实例化二叉树类 public Text(int date){ this.dat
阅读全文
在1—100之间的所有素数之和
摘要:<body> This is my JSP page. <br> <%! int counnum(){ int i=0, j=0,count=0; for(i=1;i<=100;i++){ for(j=2;j<i;j++){ if(i%j==0){ break; } } if(i==j){ coun
阅读全文