Advertisement
sigmachto

Untitled

Jul 2nd, 2023 (edited)
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.05 KB | None | 0 0
  1. #1)
  2. n = int(input())
  3. for i in range(n+1):
  4.     if i % 3 == 0 and i % 6 != 0:
  5.         print(i,end = ' ')
  6. #Ответ: 3 9 15
  7.  
  8. #2)
  9. n = int(input())
  10. for i in range(10,n+1):
  11.     if (i % 10) % 2 == 0:
  12.         print(i,end = ' ')
  13. #Ответ: 10 12 14 16
  14.  
  15. #3)
  16. n = int(input())
  17. count = 0
  18. s = 0
  19. if n % 2 == 0:
  20.     for i in range(1,n+1):
  21.         if i % 2 == 0:
  22.             count += 1
  23.     print(count)
  24. else:
  25.     for i in range(1,n+1):
  26.         if i % 2 != 0:
  27.             s += i
  28.     print(s)
  29. #Ответ: 50 2500
  30.  
  31. #4)
  32. n = int(input())
  33. count = 0
  34. if n % 3 == 0:
  35.     m = int(input())
  36.     for i in range(1,n+1):
  37.         if i % m == 0:
  38.             count += 1
  39.     print(count)
  40. else:
  41.     for i in range(1,n + 1):
  42.         print(n ** i, end = ' ')
  43. #Ответ: 8 64 512 4096 32768 262144 2097152 16777216 14
  44.  
  45. #5)
  46. count = 0
  47. a = int(input())
  48. b = int(input())
  49. n = int(input())
  50. for i in range(n):
  51.     x = int(input())
  52.     if x % 3 == 0 or x % 4 == 0 and x > 10:
  53.         if x**2 == a ** 2 + b ** 2:
  54.             count += 1
  55. print(count)
  56. #Ответ: 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement