#25260: 請各位大神幫忙檢查我哪裡有沒考慮到的地方


timmywendell (Timmy)

School : No School
ID : 153367
IP address : [118.161.134.106]
Last Login :
2021-05-06 19:26:46
a015. 矩陣的翻轉 | From: [36.228.166.129] | Post Date : 2021-05-04 16:48

array = []

_bool=1

while _bool==1:

    while 1:

        try:

            line = list(map(int, input().split()))

        except:

            _bool=0

            break

 

        array.append(line)

        row = array[0][0]

        col = array[0][1]

        if(len(array)==row+1):

            break

    line = []

    for i in range(col):

        for j in range(1, row+1):

            print(array[j][i], end = " " if j==row-1 else "")

        print("\n")

 

送出程式碼得到

正解為3

但我印出3 8

謝謝

 
ZeroJudge Forum