SHARE
TWEET

Untitled

kirill001 Sep 17th, 2019 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>;
  2. #include<locale.h>;
  3. #include<conio.h>;
  4. #include<cmath>;
  5. int main() {
  6.     setlocale(LC_ALL, "rus");
  7.     double FirstNum, SecondNum, A, B, C, Di;
  8.     printf_s("Введите переменную А: ");
  9.     scanf_s("%lf", &A);
  10.     printf_s("Введите переменную В: ");
  11.     scanf_s("%lf", &B);
  12.     printf_s("Введите переменную С: ");
  13.     scanf_s("%lf", &C);
  14.     Di = B * B - 4 * A * C;
  15.     if (Di > 0) {
  16.         FirstNum = (-B - sqrt(Di)) / (2 * A);
  17.         SecondNum = (-B + sqrt(Di)) / (2 * A);
  18.         printf_s("Первый корень уравнения равен: %lf ", FirstNum);
  19.         printf_s("Второй корень уравнения равен: %lf ", SecondNum);
  20.     }
  21.     else if (Di == 0) {
  22.         FirstNum = (-B) / (2 * A);
  23.         printf_s("Корень уравнения равен: %lf ", FirstNum);
  24.     }
  25.     else {
  26.         puts("Корней нет");
  27.     }
  28. return 0;
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top