Вопрос задан 20.02.2019 в 20:22. Предмет Информатика. Спрашивает Власюк Андрій.

Напишите на Python программу, которая складывает два числа, которые написаны в одной строке.

Спасибо и на каком языке нужно писать программы для олимпиад?
0 0
Перейти к ответам

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

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Краснобаева Анастасия.
Import sys

print sum((float(x) for x in sys.stdin.readline().split()))

# А вообще писать нужно на том языке, на котором это разрешено,
# и на котором ты сможешь решить задачу быстро и эффективно
# C++ вместе с STL хорош, но на питоне писать быстрее
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Writing a Program to Add Two Numbers in Python

To write a program in Python that adds two numbers written in a single line, you can use the following code:

```python # Input the two numbers separated by a space input_numbers = input("Enter two numbers separated by a space: ")

# Split the input string into two numbers num1, num2 = map(int, input_numbers.split())

# Add the two numbers result = num1 + num2

# Print the result print("The sum of the two numbers is:", result) ```

This program takes input in the form of two numbers separated by a space, splits the input string into two numbers, adds them together, and then prints the result.

Language for Programming Olympiads

Programming Olympiads often allow multiple programming languages for competition. Some commonly used languages include C++, Java, Python, and Pascal. Each language has its own strengths and weaknesses, and participants can choose the language they are most comfortable with for solving problems during the competition.

In general, the choice of language for programming in Olympiads depends on the participant's familiarity and proficiency with the language, as well as the specific requirements and rules of the competition.

If you have any more questions or need further assistance, feel free to ask!

0 0

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

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

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