import javax.swing.text.StyledEditorKit.ForegroundAction;
public class Work4 {
public static void main(String[] args) {
// TODO Auto-generated method stub
// a();
a1();
}
private static void a() {
int count = 0;
// 声明由数字组成的数
int n = 8;
// 一位数
count = n / 2;
System.out.println(+count);
// 两位数
count += (n - 1) * (n / 2);
System.out.println(count);
// 三位数
count += (n - 1) * n * (n / 2);
// 四位数
count += (n - 1) * n * n * (n / 2);
// 五位数
count += (n - 1) * n * n * n * (n / 2);
// 六位数
count += (n - 1) * n * n * n * n * (n / 2);
// 七位数
count += (n - 1) * n * n * n * n * n * (n / 2);
// 八位数
count += (n - 1) * n * n * n * n * n * n * (n / 2);
System.out.println("0-7所能组成的奇数个数:" + count);
}
private static void a1() {
int he = 0;
int sum = 0;
for (int i = 1; i <= 8; i++) {
if (i == 1) {
he = 4;
} else if (i == 2) {
he = 4*7;
} else {
he = he * 8;
}
sum +=he;
}
System.out.println(sum);
}
}
public class Work4 {
public static void main(String[] args) {
// TODO Auto-generated method stub
// a();
a1();
}
private static void a() {
int count = 0;
// 声明由数字组成的数
int n = 8;
// 一位数
count = n / 2;
System.out.println(+count);
// 两位数
count += (n - 1) * (n / 2);
System.out.println(count);
// 三位数
count += (n - 1) * n * (n / 2);
// 四位数
count += (n - 1) * n * n * (n / 2);
// 五位数
count += (n - 1) * n * n * n * (n / 2);
// 六位数
count += (n - 1) * n * n * n * n * (n / 2);
// 七位数
count += (n - 1) * n * n * n * n * n * (n / 2);
// 八位数
count += (n - 1) * n * n * n * n * n * n * (n / 2);
System.out.println("0-7所能组成的奇数个数:" + count);
}
private static void a1() {
int he = 0;
int sum = 0;
for (int i = 1; i <= 8; i++) {
if (i == 1) {
he = 4;
} else if (i == 2) {
he = 4*7;
} else {
he = he * 8;
}
sum +=he;
}
System.out.println(sum);
}
}