Advertisement
Kotuara

Практика7.9

Dec 23rd, 2020
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Main {
  6.  
  7.     interface Counter {
  8.         double Discriminant(double a, double b, double c);
  9.     }
  10.  
  11.     public static void main(String[] args) {
  12.         double a, b, c;
  13.         Scanner vvod = new Scanner(System.in);
  14.         System.out.println("Введите значения для a, b, c: ");
  15.         a=vvod.nextDouble();
  16.         b=vvod.nextDouble();
  17.         c=vvod.nextDouble();
  18.  
  19.         Counter Ref = (double A, double B, double C) -> {
  20.             double D = B * B - 4 * A * C;
  21.             return D;
  22.         };
  23.  
  24.         System.out.println("Дискриминант: " +Ref.Discriminant(a, b, c));
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement