Almost alphabetical by vklonghml

while 1:
    a=raw_input()
    j=a[0]
    for i in range(1,len(a)):
        if a[i] < a[i-1]:
            j=a[i]
            if i+1 < len(a) and a[i+1] >= a[i-1]:
                print j;break
            elif i+1>=len(a):
                print j;break
            else:
                print a[i-1];break

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

To protect the system from spam, please input your favorite sport (hint: I believe its name must start with 'g', case insensitive)

download

return to the top page