1.9 编程基础之顺序查找 10 找最大数序列(5分) python
生活随笔
收集整理的這篇文章主要介紹了
1.9 编程基础之顺序查找 10 找最大数序列(5分) python
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
http://noi.openjudge.cn/ch0109/10/
"""1.9 編程基礎之順序查找 10 找最大數序列(5分) http://noi.openjudge.cn/ch0109/10/使用python創建一個n*空的二維數組 https://blog.csdn.net/weixin_40378404/article/details/93214422//k是第二維數組的個數 arr=[[] for i in range(k)]python創建二維列表的兩種方法 https://blog.csdn.net/liangjiubujiu/article/details/82153095Python中List二維數組 https://blog.csdn.net/mimi9919/article/details/51458342Python 創建二維列表list https://blog.csdn.net/cxj540947672/article/details/85257589python list 創建二維數組的坑 https://blog.csdn.net/lccrun/article/details/98205870python list二維數組列數_Python創建二維數組的正確姿勢 https://blog.csdn.net/weixin_39658759/article/details/113582574 https://blog.csdn.net/figo8875/article/details/90300989 https://blog.csdn.net/yockie/article/details/46127829在多維數組中遍歷其中的單個元素 --python https://blog.csdn.net/weixin_43236007/article/details/104476943三、Python語法基礎---序列、列表、元組 https://blog.csdn.net/qq_37958578/article/details/104809927 https://www.jb51.net/article/142196.htm""" n=int(input())num_list = [ [] for i in range(n)] #print(num_list)k=0 max=0 while k<n:a=list(map(int,input().split(',')))lena=len(a)#print(lena)i=0while i<lena:num_list[k].append(a[i])if a[i]>max:max=a[i]i+=1k+=1print(max) #print(num_list)ans=[]k=0 while k<n:for num in num_list[k]:if num==max:#print(k+1,end=',')ans.append(k+1)k+=1 #print(ans)lenx=len(ans)j=0while j<lenx-2:print(ans[j],end=',')j+=1 print(ans[j])總結
以上是生活随笔為你收集整理的1.9 编程基础之顺序查找 10 找最大数序列(5分) python的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Mysql数据库,项目需求需要数据还原的
- 下一篇: 微信小程序,小游戏sockect报错修复