隨機9個電話號碼

package week;java

import java.util.Random;dom

public class TelePhoneNumber {
public static void main(String[] args) {
Random random = new Random();
int[] nums = new int[10];
for(int i = 0 ; i < 9; i++){
System.out.print(1);
for(int j = 0; j <10 ;j++){
if(j == 0){
nums[j] = random.nextInt(7)+3;
System.out.print(nums[j]);
continue;
}
nums[j] = random.nextInt(10);
System.out.print(nums[j]);
}
System.out.println();
}
}blog

}class

相關文章
相關標籤/搜索