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:plz help meIn Reply To:Re:plz help me Posted by:Iambitious at 2007-08-05 13:11:18 > And if I use Scanner there is nothing happened > But Scanner take so many time that I got tle. can use this function static int ni() { int v = 0; char t = 0; boolean neg = false; try { while (!Character.isDigit(t = (char) System.in.read()) && t != '-') ; if (t == '-') { neg = true; t = '0'; } do { v *= 10; v += t - '0'; } while (Character.isDigit(t = (char) System.in.read())); } catch (Exception e) { } return neg ? -v : v; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator