herrDeng網內搜尋
自訂搜尋
Ads
訂閱:
張貼留言 (Atom)
熱門文章
-
計算你的BMI
-
GCD(10^10+1, 10^11+2)=?
-
輸出你的課表 含Java code以及結果
-
1. 利用遞迴input n算2^n 2. 用C算GCD(3333,456)
-
請用 C/C++/java寫一簡易程式
-
一、 試利用switch case由程式中直接輸入一個1~7 之間的整數day,代表星期一到星期日。若day 的值是1,則印出 "星期一",若day 的值是2,則印出 "星期二",若day 的值是7,則印出 "星期日",...
-
BMI (Body Mass Index)= 體重 (kg) / 身高 ^2(m 2 ) 在台灣,行政院衛生署乃根據其相關研究,於2002年4月公佈台灣成人肥胖標準: BMI<18.5 為過輕, 18.5≦BMI<24 為正常體重, 24≦BMI<27 為過重, BM...
-
33, 45, 87, 99, 27 算平均
15 則留言:
import java.security.SecureRandom;
import java.util.Random;
public class aa {
public static void main(String[] args) {
Random rnd= new SecureRandom();
int[]x=new int[7];
outer: for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49)+1;
for(int j=0; j<i; j++){
if(x[j]==x[j]){
i--;
continue outer;
}
}
System.out.print("x["+i+"]="+x[i]+"\t");
}
System.out.println();
}
}
import java.security.SecureRandom;
import java.util.Random;
public class aa {
public static void main(String[] args) {
Random rnd= new SecureRandom();
int[]x=new int[7];
outer: for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49)+1;
for(int j=0; j<i; j++){
if(x[j]==x[j]){
i--;
continue outer;
}
}
System.out.print("x["+i+"]="+x[i]+"\t");
}
System.out.println();
}
}
import java.security.SecureRandom;
import java.util.Random;
public class aa {
public static void main(String[] args) {
Random rnd= new SecureRandom();
int[]x=new int[7];
outer: for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49)+1;
for(int j=0; j<i; j++){
if(x[j]==x[j]){
i--;
continue outer;
}
}
System.out.print("x["+i+"]="+x[i]+"\t");
}
System.out.println();
}
}
import java.security.SecureRandom;
import java.util.Arrays;
public class ex1 {
public static void main(String[] args) {
System.out.println("產生亂數");
SecureRandom rnd=new SecureRandom();
int [] x=new int[7];
for(int i=0;i<x.length; i++){
x[i]=rnd.nextInt(49)+1;
outer: for(int j=0; j<i; j++){
if(x[j]==x[i]){
i--;
continue outer;
}
}
}
Arrays.sort(x);
for(int i=0; i<x.length; i++){
System.out.print(x[i]+"\t");
}
System.out.println();
}
}
import java.security.SecureRandom;
import java.util.Arrays;
public class gvfdgfrgfdrgthgbfgf {
public static void main(String[] args) {
System.out.println("亂數產生");
SecureRandom rnd=new SecureRandom();
int [] x=new int[7];
outer: for(int i=0;i<x.length;i++){
x[i]=rnd.nextInt(49)+1;
for (int j = 0; j < i;j++) {
if(x[j]==x[i]){
i--;
continue outer;
}
}
}
Arrays.sort(x);
for(int i=0; i<x.length; i++){
System.out.print(x[i]+"\t");
}
System.out.println();
}
}
package aaa;
import java.security.SecureRandom;
import java.util.Arrays;
public class bbbbb {
public static void main(String[] args) {
System.out.println("產生亂數");
SecureRandom rnd=new SecureRandom();
int [] x=new int[7];
outer: for(int i=0;i<x.length;i++){
x[i]=rnd.nextInt(49)+1;
for (int j = 0; j < i;j++) {
if(x[j]==x[i]) {
i--;
continue outer;
}
}
}
Arrays.sort(x);
for(int i=0; i<x.length; i++){
System.out.print(x[i]+"\t");
}
System.out.println();
}
}
import java.security.SecureRandom;
import java.util.Arrays;
public class ex2 {
public static void main(String[] args) {
System.out.println("產生亂數");
SecureRandom rnd= new SecureRandom();
int[] x=new int[7];
outer: for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49)+1;
for(int j=0; j<i; j++){
if(x[j]==x[i]){
i--;
continue outer;
}
}
}
Arrays.sort(x);
for(int i=0; i<x.length; i++){
System.out.print(x[i]+"\t");
}
System.out.println();
}
}
import java.security.SecureRandom;
import java.util.Arrays;
public class ex3 {
public static void main(String[] args) {
SecureRandom rnd=new SecureRandom();
System.out.println("產生亂數");
int x[]=new int[7];
outer: for(int i=0;i<x.length;i++){
x[i]=rnd.nextInt(49)+1;
for(int j=0;j<i;j++){
if(x[i]==x[j]){
i--;
continue outer;
}
}
}
System.out.println();
Arrays.sort(x);
for(int i=0;i<x.length;i++)
System.out.print(x[i]+"\t");
System.out.println();
}
}
import java.security.SecureRandom;
import java.util.Arrays;
public class ex4 {
public static void main(String[] args) {
SecureRandom rnd=new SecureRandom();
System.out.println("產生亂數");
int[] x=new int[7];
outer: for(int i=0;i<x.length; i++){
x[i]=rnd.nextInt(49)+1;
for(int j=0; j<i;j++){
if(x[i]==x[j]){
i--;
continue outer;
}
}
}
Arrays.sort(x);
for(int i=0;i<x.length; i++){
System.out.print(x[i]+"\t");
}
System.out.println();
}
}
import java.security.SecureRandom;
import java.util.Arrays;
public class ex3 {
public static void main(String[] args) {
System.out.println("產生亂數");
SecureRandom r = new SecureRandom();
int x[] = new int[7];
outer: for(int i=0;i<x.length;i++){
x[i]=r.nextInt(49)+1;
for(int j=0;j<i;j++){
if(x[i]==x[j]){
i--;
continue outer;
}
}
}
Arrays.sort(x);
for(int i=0;i<x.length;i++)
System.out.print(x[i]+"\t");
System.out.println();
}
}
import java.security.SecureRandom;
import java.util.Arrays;
public class a4 {//大樂透
public static void main(String[] args) {
SecureRandom rnd=new SecureRandom(); //產生安全亂數
int[] x=new int[7];//7個位子 0123456
outer: for(int i=0;i<x.length;i++){//
x[i]=rnd.nextInt(49)+1;
for(int j=0;j<i;j++){
if(x[j]==x[i]){
i--;
continue outer;
}
}
System.out.print("["+i+"]="+x[i]+"\t");
}
System.out.println();
Arrays.sort(x);
for(int i=0;i<x.length;i++){
System.out.print("["+i+"]="+x[i]+"\t");
}
System.out.println();
}
}
import java.security.SecureRandom;
public class yjhg {
public static void main(String[] args) {
SecureRandom rnd=new SecureRandom();
int [] x=new int[7];
outer: for(int i=0;i<x.length;i++){
x[i]=rnd.nextInt(49)+1;
for (int j = 0; j < i;j++) {
if(x[j]==x[i]){
i--;
continue outer;
}
}
System.out.println("x[" + i + "]=" + x[i] + "\t");
}
System.out.println();
}
}
import java.security.SecureRandom;
import java.util.Arrays;
public class bv2 {
public static void main(String[] args) {
System.out.println("亂數產生");
SecureRandom rnd=new SecureRandom();
int [] x=new int[7];
outer: for(int i=0;i<x.length;i++){
x[i]=rnd.nextInt(49)+1;
for (int j = 0; j < i;j++) {
if(x[j]==x[i]){
i--;
continue outer;
}
}
}
Arrays.sort(x);
for(int i=0; i<x.length; i++){
System.out.print(x[i]+"\t");
}
System.out.println();
}
}
import java.security.SecureRandom;
import java.util.Arrays;
public class bv2 {
public static void main(String[] args) {
System.out.println("亂數產生");
SecureRandom rnd=new SecureRandom();
int [] x=new int[7];
outer: for(int i=0;i<x.length;i++){
x[i]=rnd.nextInt(49)+1;
for (int j = 0; j < i;j++) {
if(x[j]==x[i]){
i--;
continue outer;
}
}
}
Arrays.sort(x);
for(int i=0; i<x.length; i++){
System.out.print(x[i]+"\t");
}
System.out.println();
}
}
import java.security.SecureRandom;
import java.util.Arrays;
public class bv2 {
public static void main(String[] args) {
System.out.println("亂數產生");
SecureRandom rnd=new SecureRandom();
int [] x=new int[7];
outer: for(int i=0;i<x.length;i++){
x[i]=rnd.nextInt(49)+1;
for (int j = 0; j < i;j++) {
if(x[j]==x[i]){
i--;
continue outer;
}
}
}
Arrays.sort(x);
for(int i=0; i<x.length; i++){
System.out.print(x[i]+"\t");
}
System.out.println();
}
}
張貼留言