?? guess_play.java
字號:
/**
* AWT Sample application
*
* @author
* @version 1.00 07/03/26
*
*/
public class Guess_play {
public static void main(String[] args) {
int i=(int)(Math.random()*1000),j=0,k;
System.out.println("How many times do you want to guess it?");
k=KeyInput.readInt();
System.out.println("So,you get"+" "+k+" "+"chances.Let's begin");
while(k>0){
j=KeyInput.readInt();
if(j>i){
k--;
System.out.println("It's big");}
else if(j<i){
k--;
System.out.println("It's small");}
else {
System.out.println("It's right");
break;
}
}
if(k==0)System.out.println("Sorry,you have no chance already");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -