Topic: 一个小程序 |
Print this page |
1.一个小程序 | Copy to clipboard |
Posted by: wslss007 Posted on: 2005-10-17 20:51 public class THE { public static void main(String args[]) { String str1,str2; BufferedReader buffer1; buffer1=new BufferedReader(new InputStreamReader(System.in)); System.out.print("请输入紫外线指数"); str1=buffer1.readLine(); int x=Integer.parseInt(str1); switch(x){ case 0: case 1: case 2: case 3: case 4: str2="微量级"; break; default: str2="危险级"; } System.out.println("级数"=+x+"为"+str2); } } 其中buffer1=new BufferedReader(new InputStreamReader(System.in));这个语句不明白什么意思,还有这个程序编译时有四个错误,请改正,谢谢。 |
2.Re:一个小程序 [Re: wslss007] | Copy to clipboard |
Posted by: bluecrystal Posted on: 2005-10-17 21:08
多看看书,多根据调试给出的错误信息翻书或者资料 :) 测试输出:
|
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |