herrDeng網內搜尋

自訂搜尋

Ads

2015年11月13日 星期五

ex7 猜數字

猜數字

44 則留言:

A10433028 提到...

import java.security.SecureRandom;import java.util.*;

public class AH {

public static void main(String[] args) { SecureRandom sc=new SecureRandom(); Scanner input=new Scanner(System.in); int x=sc.nextInt(100)+1; int y=0; do{ System.out.print("猜數字>>>>"); y=input.nextInt(); if(x<y) System.out.println("小一點"); else if(x>y) System.out.println("大一點"); else System.out.print("猜對了 恭喜你"); }while(x!=y); }}

A10433015 提到...

import java.util.Random;import java.util.Scanner;public class aa { public static void main(String[] args) { Random asd =new Random (); int x= asd.nextInt(100)+1; Scanner a=new Scanner(System.in); int s=0; do{System.out.println("輸入:"); s =a.nextInt(); if (s>x)System.out.println("小點"); if (s<x)System.out.println("大點"); } while(s!=x);System.out.println(x); } }

匿名 提到...

public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}

匿名 提到...

public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}

匿名 提到...

a10433019
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}

匿名 提到...

a10433029
import java.security.SecureRandom;
import java.util.Scanner;
public class exc029 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.println("猜數字");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
}while(guess!=x);
if(x==guess)
System.out.println("正解");
}
}

匿名 提到...

a10433029
import java.security.SecureRandom;
import java.util.Scanner;
public class exc029 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.println("猜數字");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
}while(guess!=x);
if(x==guess)
System.out.println("正解");
}
}

A10433013 提到...

import java.util.Random;import java.util.Scanner;public class abcd { public static void main(String[] args) { Random input=new Random(); int x=input.nextInt(100)+1; Scanner qwe=new Scanner(System.in); int a; do{ System.out.print("輸入0~100:"); a=qwe.nextInt(); if(a>x)System.out.print("比"+a+"小"+"\n"); else if(a<x)System.out.print("比"+a+"大"+"\n"); }while(a!=x); System.out.print(x+"終於猜到了"); }}

匿名 提到...

//B10133007

package b10133007;
import java.security.SecureRandom;
import java.util.*;
public class ex01 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x = rnd.nextInt(100) + 1;
int guess=0;
do{
System.out.print("猜吧!>>");
guess=input.nextInt();
if (x>guess)
System.out.println("你猜太小了");
else if(x<guess)
System.out.println("你猜太大了");
else System.out.println("恭喜你猜對啦");


}while(guess!=x);
}
}

匿名 提到...

//B10133007

package b10133007;
import java.security.SecureRandom;
import java.util.*;
public class ex01 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x = rnd.nextInt(100) + 1;
int guess=0;
do{
System.out.print("猜吧!>>");
guess=input.nextInt();
if (x>guess)
System.out.println("你猜太小了");
else if(x<guess)
System.out.println("你猜太大了");
else System.out.println("恭喜你猜對啦");


}while(guess!=x);
}
}

匿名 提到...

//A10433006
import java.security.SecureRandom;
import java.util.Scanner;
public class ex_01 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
int x,y;
x=rnd.nextInt(100)+1;
Scanner input=new Scanner(System.in);
do{
System.out.println("請輸入數字");
y=input.nextInt();
if(x>y)
System.out.println("大一點");
else if(x<y)
System.out.println("小一點");
}while(x!=y);
if(x==y)
System.out.println("答對了");
}
}

匿名 提到...

//A10433019

public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}

匿名 提到...

//A10433001
import java.security.SecureRandom;
import java.util.Scanner;
public class ex_01 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
int x,y;
x=rnd.nextInt(100)+1;
Scanner input=new Scanner(System.in);
do{
System.out.println("請輸入數字");
y=input.nextInt();
if(x>y)
System.out.println("大一點");
else if(x<y)
System.out.println("小一點");
}while(x!=y);
if(x==y)
System.out.println("答對了");
}
}

匿名 提到...

//A10433008
import java.security.SecureRandom;
import java.util.Scanner;
public class ex_01 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
int x,y;
x=rnd.nextInt(100)+1;
Scanner input=new Scanner(System.in);
do{
System.out.println("請輸入數字");
y=input.nextInt();
if(x>y)
System.out.println("大一點");
else if(x<y)
System.out.println("小一點");
}while(x!=y);
if(x==y)
System.out.println("答對了");
}
}

匿名 提到...

//B10133007

package b10133007;
import java.security.SecureRandom;
import java.util.*;
public class ex01 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x = rnd.nextInt(100) + 1;
int guess=0;
do{
System.out.print("猜吧!>>");
guess=input.nextInt();
if (x>guess)
System.out.println("你猜太小了");
else if(x<guess)
System.out.println("你猜太大了");
else System.out.println("恭喜你猜對啦");


}while(guess!=x);
}
}

匿名 提到...

//A10433019

public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}

匿名 提到...

//A10433019

public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}

匿名 提到...

A10433004


import java.security.SecureRandom;
import java.util.Scanner;
public class hello {

public static void main(String[] args) {
SecureRandom rnd=new SecureRandom();
Scanner input=new Scanner(System.in);
int x = rnd.nextInt(100) + 1;
int guess=0;
do{
System.out.print("請猜數字>>");
guess=input.nextInt();
if(x>guess)
System.out.println("在大一點");
else if(x<guess)
System.out.println("在小一點");
}while(guess!=x);
if(x==guess)
System.out.println("恭喜你答對囉");
}

匿名 提到...

a10433029
import java.security.SecureRandom;
import java.util.Scanner;
public class exc029 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.println("猜數字");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
}while(guess!=x);
if(x==guess)
System.out.println("正解");
}
}

匿名 提到...

a10433029
import java.security.SecureRandom;
import java.util.Scanner;
public class exc029 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.println("猜數字");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
}while(guess!=x);
if(x==guess)
System.out.println("正解");
}
}

匿名 提到...

//A10433019

public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}

匿名 提到...

A10433011

public class hello11 {
public static void main(String[] args) {
SecureRandom rnd = new SecureRandom();
Scanner input=new Scanner(System.in);
int x = rnd.nextInt(100)+1;
int guess= 0;
do{
System.out.println("請猜數字>>");
guess=input.nextInt();
if(x>guess)
System.out.println("大");
else if(x<guess)
System.out.println("小");
} while(guess!=x);
if(x==guess)
System.out.println("答對囉");

匿名 提到...

//A10433014

public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}

匿名 提到...

//A10433007

public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}

匿名 提到...

//A10433003

public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}

匿名 提到...

//A10433010

public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}

匿名 提到...

//A10433036

public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}

匿名 提到...

A10433039

public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}

匿名 提到...

//A10433043

public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}

A104330308 提到...

import java.security.SecureRandom;import java.util.*;

public class jimmy1111 { public static void main(String[] args) { SecureRandom rnd= new SecureRandom(); Scanner input=new Scanner(System.in); int x = rnd.nextInt(100) +1; int guess=0; do{ System.out.println("猜>>"); guess=input.nextInt(); System.out.println("請"); }while(guess!=x); }

A104330308 提到...

import java.security.SecureRandom;import java.util.*;

public class jimmy1111 { public static void main(String[] args) { SecureRandom rnd= new SecureRandom(); Scanner input=new Scanner(System.in); int x = rnd.nextInt(100) +1; int guess=0; do{ System.out.println("猜>>"); guess=input.nextInt(); System.out.println("請"); }while(guess!=x); }

A10433022 提到...

public class hello11 {

public static void main(String[] args) {

SecureRandom rnd = new SecureRandom();

Scanner input=new Scanner(System.in);

int x = rnd.nextInt(100)+1;

int guess= 0;

do{

System.out.println("請猜數字>>");

guess=input.nextInt();

if(x>guess)

System.out.println("大");

else if(x<guess)

System.out.println("小");

} while(guess!=x);

if(x==guess)

System.out.println("答對");

A10433038 提到...

public class hello11 {

public static void main(String[] args) {

SecureRandom rnd = new SecureRandom();

Scanner input=new Scanner(System.in);

int x = rnd.nextInt(100)+1;

int guess= 0;

do{

System.out.println("請猜數字>>");

guess=input.nextInt();

if(x>guess)

System.out.println("大");

else if(x<guess)

System.out.println("小");

} while(guess!=x);

if(x==guess)

System.out.println("答對了");

匿名 提到...

a10433024
mport java.util.Random;import java.util.Scanner;

public class hello {

public static void main(String[] args) { Random rnd= new Random(); int x; x=rnd.nextInt(100)+1; Scanner input=new Scanner(System.in); int guess=0; do{ System.out.print("猜>>"); guess=input.nextInt(); if(x>guess) System.out.println("數字太小"); else System.out.println("數字太大"); }while(guess!=x); if(x==guess) System.out.println("猜中數字"); }

}

A10433018 提到...

import java.security.SecureRandom;
import java.util.Scanner;
public class exc029 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.println("猜數字");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
}while(guess!=x);
if(x==guess)
System.out.println("正解");
}
}

A10433039 提到...

import java.security.SecureRandom;
import java.util.Scanner;
public class ex_01 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
int x,y;
x=rnd.nextInt(100)+1;
Scanner input=new Scanner(System.in);
do{
System.out.println("請輸入數字");
y=input.nextInt();
if(x>y)
System.out.println("大一點");
else if(x<y)
System.out.println("小一點");
}while(x!=y);
if(x==y)
System.out.println("答對了");
}
}

A10433043 提到...

import java.security.SecureRandom;
import java.util.Scanner;
public class ex_01 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
int x,y;
x=rnd.nextInt(100)+1;
Scanner input=new Scanner(System.in);
do{
System.out.println("請輸入數字");
y=input.nextInt();
if(x>y)
System.out.println("大一點");
else if(x<y)
System.out.println("小一點");
}while(x!=y);
if(x==y)
System.out.println("答對了");
}
}

10433020 遲 提到...

mport java.util.Random;import java.util.Scanner;

public class hello {

public static void main(String[] args) { Random rnd= new Random(); int x; x=rnd.nextInt(100)+1; Scanner input=new Scanner(System.in); int guess=0; do{ System.out.print("猜>>"); guess=input.nextInt(); if(x>guess) System.out.println("數字太小"); else System.out.println("數字太大"); }while(guess!=x); if(x==guess) System.out.println("猜中數字"); }

}

2015年11月13日 下午3:43

A10433003 提到...

public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}

A10433007 提到...

public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}

A10433010 提到...

public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}

A10433014 提到...

public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}

B10133189 提到...

import java.security.SecureRandom;
import java.util.Scanner;
public class hello {

public static void main(String[] args) {
SecureRandom rnd=new SecureRandom();
Scanner input=new Scanner(System.in);
int x = rnd.nextInt(100) + 1;
int guess=0;
do{
System.out.print("請猜數字>>");
guess=input.nextInt();
if(x>guess)
System.out.println("在大一點");
else if(x<guess)
System.out.println("在小一點");
}while(guess!=x);
if(x==guess)
System.out.println("恭喜你答對囉");
}

A10433014 提到...

import java.security.SecureRandom;
import java.util.Scanner;
public class ex_01 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
int x,y;
x=rnd.nextInt(100)+1;
Scanner input=new Scanner(System.in);
do{
System.out.println("請輸入數字");
y=input.nextInt();
if(x>y)
System.out.println("大一點");
else if(x<y)
System.out.println("小一點");
}while(x!=y);
if(x==y)
System.out.println("答對了");
}
}

Related Posts Plugin for WordPress, Blogger...

熱門文章