| ||||||||||
| 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 | |||||||||
Re:我是这么处理那个恶心的输入的……In Reply To:我是这么处理那个恶心的输入的…… Posted by:393570442 at 2011-09-27 18:00:59 int get(){
char ch=getchar();
while(ch<'0'|| ch>'9') ch=getchar();
int x=0;
while(ch>='0' && ch<='9'){
x*=10;
x+=ch-'0';
ch=getchar();
}
return x;
}
字符读入格外好用,而且很快~~
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator