大家帮忙看看这个程序怎么无法运行

来源:百度知道 编辑:UC知道 时间:2024/09/22 15:52:48
import java.io.*;
public class jiangp{
public static void main(String args[])throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int a = Integer.parseInt(br.readline());
switch(a){
case 1: System.out.println("奖品是汽车");break;
case 2: System.out.println("奖品是笔记本电脑");break;
case 3: System.out.println("奖品是冰箱");break;
default:System.out.println("在来一次");
}
}
}

import java.io.*;
public class jiangp{
public static void main(String args[])throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String s=(String)br.readLine();
int a = Integer.parseInt(s);
switch(a){
case 1: System.out.println("奖品是汽车");break;
case 2: System.out.println("奖品是笔记本电脑");break;
case 3: System.out.println("奖品是冰箱");break;
default:System.out.println("在来一次");
}
}
}