算法题1:1,1,2,3,5,8,13,21,34,55...请用递归的方法求出第30个数字。

算法题2:使用冒泡法进行排序。

 

  1. public class MaoPaoPaiXu { 
  2.      
  3.     public static void main(String[] args) 
  4.     { 
  5.         int [] arr = {3,5,2,7,9}; 
  6.         int temp = 0
  7.         for(int i = 0 ;i<arr.length;i++) 
  8.         { 
  9.             for(int j = 0;j<arr.length-1;j++) 
  10.             { 
  11.                 if(arr[i]<arr[j]) 
  12.                 { 
  13.                     temp = arr[i]; 
  14.                     arr[i] = arr[j]; 
  15.                     arr[j] = temp; 
  16.                 } 
  17.             } 
  18.         } 
  19.         for(int k :arr) 
  20.         { 
  21.             System.out.println(k); 
  22.         } 
  23.     } 

数据库题:多表查询