提供了常用的JAVA技术的示例

源代码在线查看: guessnumber.java~6~

软件大小: 1017 K
上传用户: 5201314
关键词: JAVA
下载地址: 免注册下载 普通下载 VIP

相关代码

				package guessnumber;								import javax.swing.UIManager;				import java.awt.*;				import java.io.*;								public class guessnumber {								  //Main method				  public static void main(String[] args) throws IOException {				    int magic=30;				    int guess;								    do{				    InputStreamReader ir;				    BufferedReader in;				    ir=new InputStreamReader(System.in);				    in=new BufferedReader(ir);				    System.out.println("input key is :");				    String s=in.readLine();				    guess=Integer.parseInt(s);								    if (guess!=magic)				       {				        System.out.print("wrong, ");				        if (guess>magic)				            System.out.println("too high !");				        else				            System.out.println("too low !");				       }				    }while(guess!=magic);				    System.out.print("right !");				  }				}			

相关资源