boris-vlasenko

Генератор

Oct 23rd, 2018
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. columns, values = map(int,input().split())
  2.  
  3. def f(s,column):
  4.     for i in range(1,values+1):
  5.         if column >= columns:
  6.             print(s,i)
  7.         else:
  8.             if s:
  9.                 f(s+' ' + str(i),column+1)
  10.             else:
  11.                 f(str(i),column+1)
  12.        
  13. f('',1)
Advertisement
Add Comment
Please, Sign In to add comment