#include<stdio.h>
#include<math.h>
int main()
{
int a, b, c, d, e, f, g, h, i;
for (int p = 123; p <= 329; p++)
{
int n = p;
a = n / 100;
b = n / 10 % 10;
c = n % 10;
n *= 2;
d = n / 100;
e = n / 10 % 10;
f = n % 10;
n = n / 2 * 3;
g = n / 100;
h = n / 10 % 10;
i = n % 10;
for (int j = 1; j <= 9;j++)
if (j != a&&j != b&&j != c&&j != d&&j != e&&j != f&&j != g&&j != h&&j != i)
goto x1;
printf("%d%d%d %d%d%d %d%d%d\n", a, b, c, d, e, f, g, h, i);
x1:;
}
return 0;
}
习题2-6 排列
最新推荐文章于 2019-07-18 10:05:42 发布