← Back to List

18883번: N M 찍기 ↗

Solutions

Python 3
187 B | 187 chars
N,M=map(int,input().split())
for i in range(N):
    for j in range(M):
        if(j != M-1):
            print(i*M+j+1,end=" ")
        else:
            print(i*M+j+1,end="")
    print()