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

  • <center id="usuqs"></center>
  • 
    
  • java求0—7所能組成的奇數(shù)個數(shù)

    java求0—7所能組成的奇數(shù)個數(shù)
    其他人氣:165 ℃時間:2020-09-17 04:24:22
    優(yōu)質(zhì)解答
    public class CountTest {
    /**
    * @param args
    */
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    int i = 7;
    System.out.println("0—" + i + "所能組成的奇數(shù)個數(shù):");
    count(i);
    }
    public static int count(int num) {
    if(num == 0)
    return 0;
    if(num == 1)
    return 1;
    int sum = 0;
    int temp = 0;
    if(num%2 == 0)
    temp = num/2;
    else
    temp = num/2 + 1;
    sum += temp;
    System.out.println("1位數(shù)" + sum + "個,算法:偶數(shù)除以2;奇數(shù)除以2加1");
    for(int i=0; i
    我來回答
    類似推薦
    請使用1024x768 IE6.0或更高版本瀏覽器瀏覽本站點,以保證最佳閱讀效果。本頁提供作業(yè)小助手,一起搜作業(yè)以及作業(yè)好幫手最新版!
    版權所有 CopyRight © 2012-2024 作業(yè)小助手 All Rights Reserved. 手機版