Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
我用的是readline()然后用null来判断输入结束?In Reply To:对了,你要多帮帮用java的新人啊 Posted by:hawk at 2004-11-02 12:40:14 我是这样做的: BufferedReader iner = new BufferedReader(new InputStreamReader(System.in)); while(true){ try{ rom=iner.readLine(); if(rom==null)break; }catch(IOException e){} n=rom.charAt(0); switch(n){ case '+':Add();break; case '-':Sub();break; case '*':Rid();break; case '/':Div();break; case '=':Printer();break; default: number=Getroma(rom); if(number>0&&number<4999) st.push(Integer.toString(number)); else ender+="out of range exception\n"; break; }; } 我自己测试了很多没有错,也提交了很多次但是总是WA,所以我想是不是我判定输入结束的方法错了,谢谢,指教:) Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator