fork(3) download
import fileinput
err = False
for line in fileinput.input():
	line = line.rstrip('\n')
	if line != "".join(sorted(line)):
		err = True
		print("[%d] Bad line: %s" % (fileinput.lineno(), line))
		
if not err:
	print("All ok!")
Success #stdin #stdout 0.02s 8688KB
stdin
Press edit.
Then paste code here. 
stdout
[1] Bad line: Press edit.
[2] Bad line: Then paste code here.