输入挂

 1 int scan()
 2 {
 3     int res = 0 , ch;
 4     while( !( ( ch = getchar() ) >= '0' && ch <= '9' ) )
 5     {
 6         if( ch == EOF )  return 1 << 30 ;
 7     }
 8     res = ch - '0' ;
 9     while( ( ch = getchar() ) >= '0' && ch <= '9' )
10         res = res * 10 + ( ch - '0' ) ;
11     return res ;
12 }
View Code

 

posted @ 2015-09-23 18:43  一麻袋码的玛侬  阅读(87)  评论(0)    收藏  举报