import random
numbers = [random.randint(-100, 100) for _ in range(5)]
print("Сгенерированные числа:", numbers)
max_num = numbers[0]
for num in numbers[1:]:
if num > max_num:
max_num = num
print("Максимальное число:", max_num)
import random
def generate_random_numbers(count, lower_bound, upper_bound):
return [random.randint(lower_bound, upper_bound) for _ in range(count)]
def find_maximum(numbers):
return max(numbers)
def main():
count = 5
lower_bound = -100
upper_bound = 100
numbers = generate_random_numbers(count, lower_bound, upper_bound)
print("Сгенерированные числа:", numbers)
max_number = find_maximum(numbers)
print("Максимальное число:", max_number)
if __name__ == "__main__":
main()