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 |
我已经决定了,不论何种比赛,long long与浮点数的读入输出统统自己写函数In Reply To:我用"%lf"读入,得到了一堆WA,改成cin竟然直接AC Posted by:fanhqme at 2010-07-27 11:43:08 double readDouble(){ char c=getchar(); while ((c>'9' || c<'0') && c!='.')c=getchar(); double r=0.0; if (c!='.'){ r=(double)(c-'0'); while (c=getchar(),'0'<=c && c<='9') r=10.0*r+(double)(c-'0'); } if (c=='.'){ double t=0.1; while (c=getchar(),'0'<=c && c<='9') r=r+t*(c-'0'),t=t*0.1; } return r; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator