Вопрос задан 20.02.2019 в 04:59. Предмет Информатика. Спрашивает Радюкина Полина.

Составьте программу нахождения значения выражения (a-(d+21)*2)*(c-7*k), где значения переменных а,

d, с, и k вводятся с клавиатуры.
0 0
Перейти к ответам

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

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Козирська Аліна.
var
  a, d, c, k: real;

begin
  readln(a, d, c, k);
  writeln((a - (d + 21) * 2) * (c - 7 * k));
end.
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Program to Evaluate an Expression

To create a program to evaluate the expression *(a-(d+21)\*2)\*(c-7\*k)*, where the values of the variables a, d, c, and k are input from the keyboard, you can use the following Python code:

```python # Input values for variables a, d, c, and k a = int(input("Enter the value of a: ")) d = int(input("Enter the value of d: ")) c = int(input("Enter the value of c: ")) k = int(input("Enter the value of k: "))

# Evaluate the expression result = (a - (d + 21) * 2) * (c - 7 * k)

# Print the result print("The result of the expression is:", result) ```

This program prompts the user to input the values of variables a, d, c, and k, then evaluates the given expression and displays the result.

Example Usage

For example, if the user inputs: - a = 5 - d = 10 - c = 3 - k = 2

The program will calculate the result of the expression *(5-(10+21)\*2)\*(3-7\*2)* and display the output.

Note: This code is written in Python and assumes that the user will input integer values for the variables a, d, c, and k.

[[8 #]]

0 0

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

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

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