AlexKost12

05. Digits

Jul 26th, 2022
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. n = int(input())
  2.  
  3. x1 = n // 100
  4. x2 = (n // 10) % 10
  5. x3 = n % 10
  6.  
  7. for i in range(x1 + x2):
  8.     for j in range(x1 + x3):
  9.         if n % 5 == 0:
  10.             n -= x1
  11.             print(n, end=" ")
  12.         elif n % 3 == 0:
  13.             n -= x2
  14.             print(n, end=" ")
  15.         else:
  16.             n += x3
  17.             print(n, end=" ")
  18.     print()
Advertisement
Add Comment
Please, Sign In to add comment