输入外挂

View Code
inline bool scan_d(int &num) {  //  外挂输入    
    char in;bool IsN=false;  
    in=getchar();  
    if (in == EOF)  return false;  
    while (in!='-' &&( in<'0'||in>'9')) in=getchar();  
    if (in == '-')   { IsN=true;num=0;}  
    else num=in-'0';  
    while (in=getchar(),in>='0'&&in<='9') { num*=10,num+=in-'0';}  
    if(IsN)   num=-num;  
    return true;  
} 

 

posted @ 2013-04-20 19:33  zhang1107  阅读(112)  评论(0编辑  收藏  举报