2008-01-07 21:06:35鮭魚
鍵盤輸入範例
import java.io.*;
public class Hi {
public static void main(String[] args) throws IOException {
// TODO 自動產生方法 Stub
String msg;
int count;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("77");
try {
msg = br.readLine();
count = Integer.parseInt(msg);
System.out.println(count);
} catch (NumberFormatException e) {
// TODO 自動產生 catch 區塊
System.out.println("88");
}
}
}
public class Hi {
public static void main(String[] args) throws IOException {
// TODO 自動產生方法 Stub
String msg;
int count;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("77");
try {
msg = br.readLine();
count = Integer.parseInt(msg);
System.out.println(count);
} catch (NumberFormatException e) {
// TODO 自動產生 catch 區塊
System.out.println("88");
}
}
}