In [4]:
a=int(input('请输入需输入整数个数:'))
max=int(input('请输入一个整数:'))
sec=int(input('请输入一个整数:'))
if max<sec:
    b=max
    max=sec
    sec=b
i=1
while i<(a-1):
    i=i+1
    n=int(input('请输入一个整数:'))
    if n>=max:
        c=max
        max=n
        sec=c
    elif n<max and n>=sec:
        sec=n
print(sec)


请输入需输入整数个数:5
请输入一个整数:6
请输入一个整数:7
请输入一个整数:3
请输入一个整数:4
请输入一个整数:8
7

In [ ]: