| ||||||||||
| 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 | |||||||||
顶In Reply To:快速读入 Posted by:yygy at 2014-07-01 18:49:23 > bool dig(char x){return x>='0'&&x<='9';}
> int getval()
> {
> int ret=0,sign=1;
> char c;
> while(!dig(c=getchar())&&c!='-');
> if(c=='-')sign=-1;
> else ret=c-'0';
> while(dig(c=getchar()))ret=ret*10+c-'0';
> return ret*sign;
> }
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator