close
import java.util.*;
import java.io.*;
public class question01 {
public static void main(String args[])throws IOException {
Random i=new Random();
int a;
int b=0;
while (true){
a=i.nextInt();
if ((a>=1)&&(a }
BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
while (true){
b++;
System.out.print("請輸入1~5000的整數:");
int input=Integer.parseInt(buf.readLine());
if (input>a) System.out.println("太大");
if (input if (input==a) {
System.out.println("第"+b+"次,答案為"+a);
break;
}
}
System.out.println(a);
}
}
全站熱搜
留言列表