日期:2014-05-20 浏览次数:20816 次
public static BufferedInputStream bis = new BufferedInputStream(System.in);
public static int getInt() throws IOException
{
int i;
while ((i = bis.read()) < 45)
;
// if(i==-1)
// return -1;
int temp = 0, mark = 1;
if (i == 45)
{
mark = -1;
i = bis.read();
}
while (i > 47)
{
temp = temp * 10 + i - 48;
i = bis.read();
}
return mark * temp;
}