3个回答
展开全部
如果我没有理解错的你的意思,那么你要的程序如下:
public class Permutation {
public static int permutation(int number) {
int f = 0;
if (number == 0)
f = 1;
if (number > 0)
f = number * permutation(number - 1);
return f;
}
public static void main(String[] args) {
System.out.println("3个数的无重复全排列:" + permutation(3));
}
}
public class Permutation {
public static int permutation(int number) {
int f = 0;
if (number == 0)
f = 1;
if (number > 0)
f = number * permutation(number - 1);
return f;
}
public static void main(String[] args) {
System.out.println("3个数的无重复全排列:" + permutation(3));
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询