Oo緣來是你oO


          posts - 120,comments - 125,trackbacks - 0


          public class Fibonacci {

              
          private static int MAX = 100;
              
          /*
               * print the Fibonacci sequence for values < MAX
               
          */
              
          public static void main(String[] args) {
                  
          int currentVal    = 1;
                  
          int nextVal        = 1;
                  
          while(currentVal<MAX){
                      System.out.println(currentVal);
                      nextVal 
          = nextVal + currentVal ;
                      currentVal 
          = nextVal - currentVal;
                  }
              }
          }



          馬嘉楠
          jianan.ma@gmail.com

          posted on 2007-04-18 16:47 馬嘉楠 閱讀(459) 評論(0)  編輯  收藏 所屬分類: SoureCode
          主站蜘蛛池模板: 上虞市| 繁昌县| 循化| 宜都市| 奉节县| 韩城市| 天长市| 新安县| 扶绥县| 武乡县| 荔浦县| 陆良县| 蚌埠市| 长葛市| 雷山县| 米脂县| 盐源县| 台江县| 孝感市| 金坛市| 闻喜县| 岗巴县| 崇左市| 阿城市| 长汀县| 通河县| 遂宁市| 乡城县| 凉城县| 滦南县| 襄樊市| 宁陵县| 新绛县| 蓬莱市| 贺兰县| 玉田县| 双辽市| 康平县| 名山县| 兰坪| 乾安县|