herrDeng網內搜尋

自訂搜尋

Ads

2014年4月22日 星期二

Java練習(Random)

輸出5個0~99的int亂數

26 則留言:

B10233092 提到...

package sss;

import java.util.*;

public class qwe {

public static void main(String[] args) {
Random rnd=new Random();
int x[]=new int[5];
for(int i=0; i<5; i++){
x[i]=rnd.nextInt(100);
System.out.println(x[i]);
}
}

}

B10233091 提到...

package hello0422;

import java.util.*;

public class helloex2 {

public static void main(String[] args) {
Random rnd=new Random();
int x[]=new int [5];
for (int i=0;i<5;i++){
x[i]=rnd.nextInt(100);
System.out.println(x[i]);
}

}

}

B10233062 黃聖評 提到...

package she;
import java.util.*;
public class shr156 {
public static void main(String[]args) {
Random rnd=new Random();
int x = 0;
for(int i=0;i<5;i++){
x =rnd.nextInt(100);
System.out.println(x);
}
}
}

B10233067 提到...

package hello0422;
import java.util.*;
public class ex2 {
public static void main(String[] args) {
Random rnd=new Random();
int x;
for (int i=0;i<5;i++){
x=0+rnd.nextInt(100);
System.out.println(x);
}
}
}

B10233089 提到...

package hello0422;
import java.util.Random;
public class ex2 {
public static void main(String[] args) {
Random rnd=new Random();
int x;
for (int i=0;i<5;i++){
x=0+rnd.nextInt(100);
System.out.println(x);
}
}
}

B10233108 林宣瑋 提到...

package ex1;

import java.util.Random;

public class ex2 {

public static void main(String[] args) {
Random rnd = new Random();
int x[]=new int[5];
for(int i=0;i<5;i++){
x[i]=rnd.nextInt(100);
System.out.println(x[i]);
}
}

}

Y10211027張君弘 提到...

package ex1;

import java.util.*;

public class hello4222 {

public static void main(String[] args) {
Random rnd=new Random();
int x[]=new int[5];
for(int i=0; i<5; i++){
x[i]=rnd.nextInt(100);
System.out.println(x[i]);
}

}

}

B10233090 提到...

package bbbb;
import java.util.*;
public class gsgsg3 {

public static void main(String[] args) {
Random rnd=new Random();
int x[]=new int [5];
for(int i=0;i<5;i++){
x[i]=rnd.nextInt(100);
System.out.println(x[i]);
}

}

}

B10233061吳興強 提到...

package hello;
import java.util.*;
public class hello {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
Random rnd=new Random();
int x ;
for (int i=0;i<5;i++){
x=rnd.nextInt(100);
System.out.println(x);

}
}
}

B10233081 藍立凱 提到...

package ex1;
import java.util.*;
public class ex3 {

public static void main(String[] args) {
Random rnd=new Random();
int x[]=new int [5];
for(int i=0;i<5;i++){
x[i]=rnd.nextInt(100);
System.out.println(x[i]);
}


}

}

B10233064莊英霆 提到...

import java.util.*;

public class hello1 {

public static void main(String[] args) {

Scanner input=new Scanner(System.in);
Random rnd=new Random();
int x ;
for(int i=0;i<5;i++);
x=rnd.nextInt(100);
System.out.println(x);
}
}

B10233087黃少洋 提到...

package free; import java.util.*; public class free2 { public static void main(String[]args) { Random rnd=new Random(); int x = 0; for(int i=0;i<5;i++){ x =rnd.nextInt(100); System.out.println(x); } } }

B10233076 提到...

package hello;
import java.util.*;
public class ex1 {

public static void main(String[] args) {
Random rnd=new Random();
int x;
for(int i=0;i<5;i++){
x=rnd.nextInt(100);
System.out.println(x);
}

}

}

B10233072黃君寰 提到...

package ex2;

import java.util.Random;

public class aa {

public static void main(String[] args) {
Random rnd=new Random();
int x[]=new int[5];
for(int i=0; i<5; i++){
x[i]= rnd.nextInt(100);
System.out.println(x[i]);
}

}

}

B10233069連于傑 提到...

package ex1;

import java.util.Random;

public class helloEx2 {

public static void main(String[] args) {
Random rnd=new Random();
int x;
for (int i=0 ;i < 5;i++){
x=rnd.nextInt(100);
System.out.println(x);
}
}

}

B10233107蔡育霖 提到...

package ex1;

import java.util.*;

public class hello4222 {

public static void main(String[] args) {
Random rnd=new Random();
int x[]=new int[5];
for(int i=0; i<5; i++){
x[i]=rnd.nextInt(100);
System.out.println(x[i]);
}

}

}

B10233097 邱宥甄 提到...

package zz;

import java.util.Random;

public class ex2 {

public static void main(String[] args) {
Random rnd = new Random();
int x[]=new int [5];
for (int i=0;i<5;i++){
x[i]=rnd.nextInt(100);
System.out.println(x[i]);
}
}

}

B10233110徐上竣 提到...

package abbaab;
import java.util.*;
public class baabba {

public static void main(String[] args) {
Random rnd=new Random();
int x[]=new int [5];
for(int i=0;i<5;i++){
x[i]=rnd.nextInt(100);
System.out.println(x[i]);
}


}

}

B10233098 陳孟緣 提到...

package VV;

import java.util.Random;

public class ex1 {

public static void main(String[] args) {
Random rnd = new Random();
int x[]=new int [5];
for (int i=0;i<5;i++){
x[i]=rnd.nextInt(100);
System.out.println(x[i]);
}
}

}

B10233080陳芊慈 提到...

package ex2;

import java.util.*;

public class asd {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int x=input.nextInt();
switch(x)
{
case 1: System.out.println("one"); break;
case 2: System.out.println("two"); break;
default: System.out.println("other");
}

}

}

B10233063 張宜禎 提到...

package hello0422;

import java.util.*;

public class ex2 {

public static void main(String[] args) {
Random rnd=new Random();
int x[]=new int[5];
for(int i=0; i<5; i++){
x[i]=rnd.nextInt(100);
System.out.println(x[i]);
}

}

}

B10233066 提到...

package aaa;

import java.util.*;

public class ggg {

public static void main(String[] args) {
Random rnd=new Random();
int x[]=new int[5];
for(int i=0; i<5; i++){
x[i]=rnd.nextInt(100);
System.out.println(x[i]);
}

}

}

b10233096 提到...

package ex1;

import java.util.*;

public class hello4111 {

public static void main(String[] args) {
Random rnd=new Random();
int x[]=new int[5];
for(int i=0; i<5; i++){
x[i]=rnd.nextInt(100);
System.out.println(x[i]);
}

}

}

B10233075 提到...


package hello0422;

import java.util.*;

public class ex2 {

public static void main(String[] args) {
Random rnd=new Random();
int x[]=new int[5];
for(int i=0; i<5; i++){
x[i]=rnd.nextInt(100);
System.out.println(x[i]);
}

}

}

B10233084 陳億如 提到...

package hello0422;

import java.util.*;

public class ex2 {

public static void main(String[] args) {
Random rnd=new Random();
int x[]=new int[5];
for(int i=0; i<5; i++){
x[i]=rnd.nextInt(100);
System.out.println(x[i]);
}
}

}

B10233074 許逸憲 提到...

package she;
import java.util.*;
public class shr156 {
public static void main(String[]args) {
Random rnd=new Random();
int x = 0;
for(int i=0;i<5;i++){
x =rnd.nextInt(100);
System.out.println(x);
}
}
}

Related Posts Plugin for WordPress, Blogger...

熱門文章