Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Task3452
- {
- class Program
- {
- static void Main(string[] args)
- {
- // Считываем 4 числа
- int a = int.Parse(Console.ReadLine());
- int b = int.Parse(Console.ReadLine());
- int c = int.Parse(Console.ReadLine());
- int d = int.Parse(Console.ReadLine());
- for (int x = 0; x <= 1000; x++) // Проверяем все числа от 0 до 1000 циклом
- if (a * x * x * x + b * x * x + c * x + d == 0) // Если уравнение равно 0, то выводим текущее значение цикла, то есть корень
- Console.WriteLine(x);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment