
Дан год. Вывести на экран на экран название животного, символизирующего этот год по восточному
календарю (cock, dog, pig, rat, bull, tiger, rabbit, dragon, snake, horse, sheep, monkey).Формат входных данных:Входной файл содержит натуральное число Формат выходных данных:В выходной файл выведите ответ на поставленную задачу.

Ответы на вопрос

x,y:integer;
a:array [1..12] of string;
begin
a[1]:=cock;
..
a[12]:=monkey;
read(x);
y:=(abs(2016-x) )mod 12;
write(a[y]);
end.
Вроде должно работать. Проверить не могу - сижу с телефона



To solve this task, you need to determine the animal symbolizing the given year according to the Eastern calendar. Here's a Python code snippet that can help you achieve this:
```python def get_animal(year): animals = ['cock', 'dog', 'pig', 'rat', 'bull', 'tiger', 'rabbit', 'dragon', 'snake', 'horse', 'sheep', 'monkey'] index = (year - 1924) % 12 return animals[index]
year = int(input("Enter the year: ")) animal = get_animal(year) print(f"The animal symbolizing the year {year} is {animal}.") ```
This code defines a function `get_animal()` that takes the year as input and returns the corresponding animal symbol. The list `animals` contains the names of the animals in the Eastern calendar order. The index of the animal is calculated using the formula `(year - 1924) % 12`, where 1924 is the start year of the Eastern calendar cycle. Finally, the code prompts the user to enter a year, calls the `get_animal()` function, and prints the result.
Please note that this code assumes the input year is a positive integer. You can modify it to handle different input requirements if needed.
Let me know if you need any further assistance!


Топ вопросов за вчера в категории Информатика
Последние заданные вопросы в категории Информатика
-
Математика
-
Литература
-
Алгебра
-
Русский язык
-
Геометрия
-
Английский язык
-
Химия
-
Физика
-
Биология
-
Другие предметы
-
История
-
Обществознание
-
Окружающий мир
-
География
-
Українська мова
-
Информатика
-
Українська література
-
Қазақ тiлi
-
Экономика
-
Музыка
-
Право
-
Беларуская мова
-
Французский язык
-
Немецкий язык
-
МХК
-
ОБЖ
-
Психология
-
Физкультура и спорт
-
Астрономия
-
Кыргыз тили
-
Оʻzbek tili