Advertisement
JmihPodvalbniy

Untitled

Feb 28th, 2024 (edited)
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.28 KB | Software | 0 0
  1. 1)
  2. n = int(input())
  3. a = n // 100
  4. b = (n // 10) % 10
  5. c = n % 10
  6. print(a + b + c)
  7.  
  8. 2)
  9. n = int(input())
  10. if n % 4 == 0 and n % 100 != 0 or n % 400 == 0:
  11.     print('YES')
  12. else:
  13.     print('NO')
  14.  
  15. 3)
  16. a = input()
  17. b = input()
  18. c = input()
  19. a = float(a)
  20. b = float(b)
  21. c = float(c)
  22. dis = b**2 - 4*a*c
  23. print('Dis = ' + str(dis))
  24. if dis < 0:
  25.     print('Нет корней')
  26. elif dis == 0:
  27.     x = -b / (2 * a)
  28.     print('x = ' + str(x))
  29. else:
  30.     x1 = (-b + discriminant ** 0.5) / (2 * a)
  31.     x2 = (-b - discriminant ** 0.5) / (2 * a)
  32.     print('x₁ = ' + str(x1))
  33.     print('x₂ = ' + str(x2))
  34.  
  35. 4)
  36. n = int(input())
  37. if (1 <= n <= 2) or (n == 12):
  38.     print('Зимний период')
  39. elif 3 <= n <= 5:
  40.     print('Весенний период')
  41. elif 6 <= n <= 8:
  42.     print('Летний период')
  43. elif 9 <= n <= 11:
  44.     print('Осенний период')
  45. else:
  46.     print('Не является временем года')
  47.  
  48. 5)
  49. a = int(input())
  50. b = int(input())
  51. c = int(input())
  52. if (a == b) or (b == c) or (c == a):
  53.     print('Yes')
  54. else:
  55.     print('No')
  56.  
  57. 6)
  58. n = int(input(''))
  59. if 1000 <= n <= 10000:
  60.     n1 = n // 1000
  61.     n2 = n // 100 % 10
  62.     n3 = n % 100 // 10
  63.     n4 = n % 10
  64.     if (n1 > n2) and (n2 > n3) and (n3 > n4):
  65.         print('Yes')
  66.     else:
  67.         print('No')
  68.  
  69. 7)
  70. n = int(input(''))
  71. if 1000 <= n <= 9999:
  72. n1 = n // 1000
  73. n2 = (n // 100) % 10
  74. n3 = (n % 100) // 10
  75. n4 = n % 10
  76. if (n1 == n4) and (n2 == n3):
  77.     print('yes')
  78. else:
  79.     print('No')
  80.  
  81. 8)
  82. a = int(input('день'))
  83. b = int(input('месяц'))
  84. c = int(input('Год'))
  85. if (1 <= a <= 31) and (1 <= b <= 7) and (b % 2 != 0) and (c > 0):
  86.     print('yes')
  87. elif (1 <= a <= 31) and (8 <= b <= 12) and (b % 2 == 0) and (c > 0):
  88.     print('yes')
  89. elif (1 <= a <= 28) and (b == 2) and (c > 0):
  90.     print('yes')
  91. else:
  92.     print('no')
  93.  
  94. 9)
  95. a = int(input("a = "))
  96. b = int(input("b = "))
  97. c = int(input("c = "))
  98. if a + b > c and a + c > b and b + c > a:
  99.     print("существует")
  100. else:
  101.     print("не существует")
  102.  
  103. 10)
  104. a = int(input('Число 1'))
  105. b = int(input('Число 2'))
  106. c = int(input('Число 3'))
  107. n1 = a + b
  108. n2 = a + c
  109. n3 = b + c
  110. if n1 > n2 and n1 > n3:
  111.     print(a, b)
  112. elif n2 > n1 and n2 > n3:
  113.     print(a, c)
  114. else:
  115.     print(b, c)
  116.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement