| ||||||||||
| 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 | |||||||||
Re:用scanner超时...数据是有问题...估计是卡C++的getchar()的.但是java数据不规范用流很麻烦In Reply To:Re:用scanner超时...数据是有问题...估计是卡C++的getchar()的.但是java数据不规范用流很麻烦 Posted by:MasterLuo at 2009-04-06 09:44:55 >
可以自己写个关于BufferedReader的nextInt
我一般都这么干
leave=0;
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
int nextInt() throws Exception
{
while (leave==0)
{
st=new StringTokenizer(in.readLine());
leave=st.countTokens();
}
leave--;
return Integer.parseInt(st.nextToken());
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator