Вопрос задан 25.02.2019 в 00:14. Предмет Информатика. Спрашивает Устюгов Кирилл.

Ввести с клавиатуры три номера школ программа должна проверить есть ли среди них номер вашей школы

Если есть то на экран выводится сообщение: номер школы есть иначе: номера школы нет
0 0
Перейти к ответам

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

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Доскина Диана.
Var
a,b,c,d:longint;
begin
readln(a); {Номер вашей школы}
readln(b,c,d); {№ школ}
if (a=b) or (c=a) or (d=a) then writeln(' номер школы есть') else writeln('номера школы нет');
end.
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Problem Description

You need to write a program that prompts the user to enter three school numbers from the keyboard. The program should then check if your school number is among them. If it is, the program should display the message "Your school number is present." Otherwise, it should display the message "Your school number is not present."

Solution

Here's a possible solution in Python:

```python # Prompt the user to enter three school numbers school_numbers = [] for i in range(3): school_number = input("Enter a school number: ") school_numbers.append(school_number)

# Check if your school number is present your_school_number = "YOUR_SCHOOL_NUMBER" # Replace with your actual school number if your_school_number in school_numbers: print("Your school number is present.") else: print("Your school number is not present.") ```

Make sure to replace `"YOUR_SCHOOL_NUMBER"` with your actual school number. This code prompts the user to enter three school numbers and stores them in a list called `school_numbers`. Then, it checks if your school number is present in the list using the `in` operator. If it is, it prints the message "Your school number is present." Otherwise, it prints the message "Your school number is not present."

Please note that this solution assumes you are using Python as the programming language. If you are using a different programming language, let me know and I can provide a solution in that language as well.

Let me know if you need any further assistance!

0 0

Топ вопросов за вчера в категории Информатика

Последние заданные вопросы в категории Информатика

Задать вопрос