第七章第二十八题(数学:组合)(Mathematics: combination)
-
*7.28(数学:组合)编写一个程序,提示用户输入10个整数,然后显示从这个10个数中选出两个数的所有组合。
*7.28(Mathematics: combination)Write a program that prompts the user to enter 10 integers, and then displays all combinations of two selected from the 10 numbers. -
参考代码:
package chapter07; import java.util.Scanner; public class Code_28 { public static void main(String[] args){ int[] nums = new int[10]; System.out.print("Enter 10 numbers:"); Scanner cin = new Scanner