Ý tưởng:
Code Python minh họa
a=[] x=0 while x!=-99: x=int(input('x= ')) if x!=-99: j=0 tim=False while j<len(a) and not(tim): if x>a[j]: j+=1 else: tim=True a.insert(j,x) print(a)
https://tritue.edu.vn/tuecode/tracnghiem30/index.php/baiviet/post/view/id/211?id=211