| ||||||||||
| 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 | |||||||||
贴个Ruby 的def seq(i)
s = ""
idx = 1
sk = ""
size = 0
while size < i
sk << idx.to_s
size += sk.size
idx += 1
end
#p s
sk[i - size - 1].chr
end
p seq 2147483647
#=> 2
嘿嘿,玩玩。
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator