Java经典习题43

/*
题目:求0—7所能组成的奇数个数。
*/
public class Class43 {

public static void main(String[] args) {
int sum = 4;
int j;
System.out.println("组成1位数是" + sum + "个");
sum = sum * 7;
System.out.println("组成2位数是" + sum + "个");
for(j = 3; j < 9; j++){
sum = sum * 8;
System.out.println("组成" + j + "位数是" + sum + "个");
}

}

}

posted on 2020-02-24 21:09  桌子哥  阅读(128)  评论(0编辑  收藏  举报