import stdio
import stdarray
import sys
# Buyruq qatori n argumentini qabul qiling.
N tartibli Adamar matritsasini # standart chiqishiga yozing . N ning kuchi 2 ga teng deb hisoblang.
n = int ( sys . argv [ 1 ])
# Matritsani yarating.
H = stdarray . create2D ( n , n , 1 )
# N tartibli Adamar matritsasini boshlang.
i1 = 1 esa i1 < n : for I2 and o'zgarib ( i1 :) for i3 ham qator ( i1 ):
H [ i2 + i1 ] [ i3 ] = H [ i2 ] [ i3 ]
H [ i2 ] [ i3 + i1 ] = H [ i2 ] [ i3 ]
H [ i2 + i1 ] [ i3 + i1 ] = else H [ i2 ] [ i3 ] i1 + = i1
Matritsani yozing.
for i yilda soha ( N ): for J yilda soha ( N ):
If H [ i ] [ j :]
stdio . write ( '1' ) else :
stdio . yozish ( '0' )
stdio . writeln ()
# python Adamar.py 8
# 11111111
# 10101010
# 11001100
# 10011001
# 11110000
# 10100101
# 11000110
# 10010110
Do'stlaringiz bilan baham: |