InputTest.java
/**
*讀取鍵盤輸入
*/
import javax.swing.JOptionPane;
public class InputTest{
public static void main(String[] args){
String strName=JOptionPane.showInputDialog("Input your name:");
String strAge=JOptionPane.showInputDialog("Input your age:");
int age=Integer.parseInt(strAge);
System.out.println("Welcome you :"+strName);
System.out.println("你還有"+(60-age)+"年可以退休了!!");
System.exit(0);
}
}
*讀取鍵盤輸入
*/
import javax.swing.JOptionPane;
public class InputTest{
public static void main(String[] args){
String strName=JOptionPane.showInputDialog("Input your name:");
String strAge=JOptionPane.showInputDialog("Input your age:");
int age=Integer.parseInt(strAge);
System.out.println("Welcome you :"+strName);
System.out.println("你還有"+(60-age)+"年可以退休了!!");
System.exit(0);
}
}
posted on 2008-10-22 13:30 郭興華 閱讀(143) 評(píng)論(0) 編輯 收藏