2025-05-12 02:48:54 +03:00
|
|
|
|
/*
|
|
|
|
|
* Author: Nikolay Dvurechensky
|
|
|
|
|
* Site: https://www.dvurechensky.pro/
|
|
|
|
|
* Gmail: dvurechenskysoft@gmail.com
|
|
|
|
|
* Last Updated: 12 мая 2025 02:47:11
|
|
|
|
|
* Version: 1.0.3
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
using System;
|
2024-10-05 09:59:53 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* 2. Введите три числа и выведите на экран значение суммы и произведения этих чисел.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace Task_Home_2___Введите_три_числа_и_выведите_их_произведение_и_сумму
|
|
|
|
|
{
|
|
|
|
|
class Program
|
|
|
|
|
{
|
|
|
|
|
static void Main(string[] args)
|
|
|
|
|
{
|
|
|
|
|
//#2
|
|
|
|
|
int g1, g2, g3, res_sum, res_multy;
|
|
|
|
|
// 1 ошибка - названия переменных g1 g2 g3 на firstValue secondValue thirdValue
|
|
|
|
|
|
|
|
|
|
Console.WriteLine("Введите число 1: ");
|
|
|
|
|
|
|
|
|
|
int.TryParse(Console.ReadLine(), out g1);
|
|
|
|
|
|
|
|
|
|
Console.WriteLine("Введите число 2: ");
|
|
|
|
|
|
|
|
|
|
int.TryParse(Console.ReadLine(), out g2);
|
|
|
|
|
|
|
|
|
|
Console.WriteLine("Введите число 3: ");
|
|
|
|
|
|
|
|
|
|
int.TryParse(Console.ReadLine(), out g3);
|
|
|
|
|
|
|
|
|
|
res_sum = g1 + g2 + g3;
|
|
|
|
|
res_multy = g1 * g2 * g3;
|
|
|
|
|
|
|
|
|
|
Console.WriteLine("Результат суммы чисел: " + res_sum);
|
|
|
|
|
|
|
|
|
|
Console.WriteLine("Результат умножения чисел: " + res_multy);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|