Advertisement
SomeBody_Aplle

Untitled

Feb 28th, 2021
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.78 KB | None | 0 0
  1.  Console.WriteLine("Лабораторная работа №2");
  2.             Console.WriteLine("SomeBody\n");
  3.             Console.WriteLine("b^2 - 4 * a/c");
  4.             Console.WriteLine("Введите значения переменных a, b и c: ");
  5.             Console.Write("a = ");
  6.             double a = int.Parse(Console.ReadLine());
  7.             Console.Write("b = ");
  8.             double b = int.Parse(Console.ReadLine());
  9.             Console.Write("c = ");
  10.             double c = int.Parse(Console.ReadLine());
  11.             for (int i = 0; i <= 0; i++)
  12.             {
  13.                 if (a < -1000 || a > 1000 || b < -1000 || b > 1000 || c < -1000 || c > 1000)
  14.                 {
  15.                     Console.WriteLine("Вы ввели некорректное значение, попробуйте снова :(");
  16.                     Console.ReadLine();
  17.                     Console.Clear();
  18.                     Console.WriteLine("Лабораторная работа №2");
  19.                     Console.WriteLine("SomeBody\n");
  20.                     Console.WriteLine("b^2 - 4 * a/c");
  21.                     Console.WriteLine("Введите значения переменных a, b и c: ");
  22.                     Console.Write("a = ");
  23.                     double repeat_1 = int.Parse(Console.ReadLine());
  24.                     Console.Write("b = ");
  25.                     double repeat_2 = int.Parse(Console.ReadLine());
  26.                     Console.Write("c = ");
  27.                     double repeat_3 = int.Parse(Console.ReadLine());
  28.                 }
  29.                 else
  30.                 {
  31.                      double result = (b * b) - 4 * a / c;
  32.                      Console.WriteLine("Результат: " + result);
  33.                      break;
  34.                 }
  35.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement