精品偷拍一区二区三区,亚洲精品永久 码,亚洲综合日韩精品欧美国产,亚洲国产日韩a在线亚洲

  • <center id="usuqs"></center>
  • 
    
  • 利用數(shù)組計(jì)算斐波那契數(shù)列的前20個(gè)數(shù),并以每行5個(gè)輸出

    利用數(shù)組計(jì)算斐波那契數(shù)列的前20個(gè)數(shù),并以每行5個(gè)輸出
    用c語言編程!
    其他人氣:511 ℃時(shí)間:2020-06-07 06:26:13
    優(yōu)質(zhì)解答
    public static void main(String[] args) {
    int n0 = 1, n1 = 1, n2; // Initialize variables
    System.out.print(n0 + " " + // Print first and second terms
    n1 + " "); // of the series
    for (int i = 0; i < 18; i++) { // Loop for the next 18 terms
    n2 = n1 + n0; // Next term is sum of previous two
    System.out.print(n2 + " "); // Print it out
    n0 = n1; // First previous becomes 2nd previous
    n1 = n2; // And current number becomes previous
    }
    System.out.println(); // Terminate the line
    }
    }
    我來回答
    類似推薦
    請(qǐng)使用1024x768 IE6.0或更高版本瀏覽器瀏覽本站點(diǎn),以保證最佳閱讀效果。本頁提供作業(yè)小助手,一起搜作業(yè)以及作業(yè)好幫手最新版!
    版權(quán)所有 CopyRight © 2012-2024 作業(yè)小助手 All Rights Reserved. 手機(jī)版