第三章 7-7 求最大值及其下标

n=int(input())
a=list(map(int,input().split()))
cnt=0
maxs=[]
for i in a:
    if i==max(a):
        maxs.append(cnt)
    cnt+=1
print('{} {}'.format(max(a),maxs[0])) 
发布了80 篇原创文章 · 获赞 6 · 访问量 7634

猜你喜欢

转载自blog.csdn.net/qq_33749437/article/details/104886253