[ create a new paste ] login | about

Link: http://codepad.org/cREcLRuP    [ raw code | output | fork ]

Ruby, pasted on Aug 27:
1
2
3
4
5
6
7
8
9
10
11
12
def next_pal(n)
	loop do
		str_n = n.to_s
		if str_n.split(//) == str_n.split(//).reverse
			return n
		end
		n += 1
	end
end


puts next_pal(345)


Output:
1
353


Create a new paste based on this one


Comments: