Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - n = int(input("Nhập số phần tử của mảng: "))
- array = []
- i = 0
- for i in range(n):
- x = int(input("Nhập phần tử thứ "+str(i+1)+": "))
- array.append(x)
- maxvalue = 0
- i=0
- num = 0
- maxnums = []
- for i in range(n):
- if(array[i]>maxvalue):
- maxvalue = array[i]
- maxnums.append(maxvalue)
- num += 1
- if(num>3):
- del(maxnums[0])
- print(maxnums)
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment                    
                 
                    