#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
题目:求0—7所能组成的奇数个数。 (不可重复 0不能做首位) 46972
0,1,2,3,4,5,6,7
一位:4
两位:4*6
三位:4*7*6-4*6 -> 4*6*6
四位:4*7*6*5-4*6*5 -> 4*6*6*5
五位:4*7*6*5*4-4*6*5*4 -> 4*6*6*5*4
...
八位:4*7*6*5*4*3*2*1-4*6*5*4*3*2*1 -> 4*6*6*5*4*3*2*1
*/
int main()
{
int count = 0;
int num = 8;
count = 4 + 4 * 6; //加一位和两位的个数
int x = 6;
for (int i = 3; i <= 8; i++)
{
count += 4 * 6 * x;
x = x * (num - i);
}
printf("%d\n", count);
return 0;
}