Advertisement
Brusnik

Untitled

Jul 2nd, 2025
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.06 KB | None | 0 0
  1. # Задание №1
  2.  
  3. n_1 = int(input())
  4.  
  5. for i in range(n_1+1):
  6.     if (i % 3 == 0) and (i % 6 != 0):
  7.         print(i)
  8.  
  9.  
  10. # Задание №2
  11.  
  12. n_2 = int(input())
  13.  
  14. for i in range(10, n_2 + 1):
  15.     if (i % 10) % 2 == 0:
  16.         print(i)
  17.  
  18.  
  19. # Задание №3
  20.  
  21. n_3 = int(input())
  22. ans_3 = 0
  23.  
  24. if n_3 % 2 == 0:
  25.     for i in range(1, n_3+1):
  26.         if i % 2 == 0:
  27.             ans_3 += 1
  28. else:
  29.     for i in range(1, n_3+1):
  30.         if i % 2 != 0:
  31.             ans_3 += i
  32.  
  33. print(ans_3)
  34.  
  35.  
  36. # Задание №4
  37.  
  38. n_4 = int(input())
  39. ans_4 = 0
  40.  
  41. if n_4 % 3 == 0:
  42.     m = int(input())
  43.     for i in range(1, n_4 + 1):
  44.         if i % m == 0:
  45.             ans_4 += 1
  46. else:
  47.     for i in range(1, n_4 + 1):
  48.         print(n_4**i)
  49.  
  50.  
  51. # Задание №5
  52.  
  53. a = int(input())
  54. b = int(input())
  55. n_5 = int(input())
  56. nums = []
  57. ans_5 = 0
  58.  
  59. for i in range(n_5):
  60.     nums.append(int(input()))
  61.     if nums[i]**2 == a**2 + b**2:
  62.         if (nums[i] > 10 and nums[i] % 3 == 0) or (nums[i] > 10 and nums[i] % 4 == 0):
  63.             ans_5 += 1
  64.  
  65. print(ans_5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement