输入外挂
2012-04-21 17:13 javaspring 阅读(179) 评论(0) 收藏 举报贴一个输入外挂的代码,说不准哪天就会用到。。。。
int Scan()
{
int res = 0 , ch;
while( !( ( ch = getchar() ) >= '0' && ch <= '9' ) )
{
if( ch == EOF ) return 1 << 30 ;
}
res = ch - '0' ;
while( ( ch = getchar() ) >= '0' && ch <= '9' )
res = res * 10 + ( ch - '0' ) ;
return res ;
}只需要在主函数中写 int x; x=Scan();即可。
当有大量输入数据的时候,输入外挂还是可以节约一定时间的。
浙公网安备 33010602011771号