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:Pascal的请进.In Reply To:Pascal的请进. Posted by:minmax at 2011-08-09 19:58:38 > function getnum:longint; > var c:char; > x:longint=0; > begin > read(c); > while not (c in num) do read(c); > while c in num do > begin > x:=x*10+ord(c)-48; > read(c); > end; > exit(x); > end; > > 用上面的函数代替read.每次读入一个数. > num:set of char=['0'..'9']; 写得很好,顶一个 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator