pierwiastki równania kwadratowego:
import java.util.*; public class Programie {
static finał Scanner input = new Scanner(System.in); public static void main(String[] args)
System.out.print("Podaj a: "); double a = input.nextDouble();
System.out.print("Podaj b: "); double b = input.nextDouble();
System.out.print("Podaj c: "); double c = input.nextDouble();
double delta = b*b-4*a*c;
double xl = (-b-Math.sqrt(delta))/(2*a); double x2 = (-b+Math.sąrt(delta))/(2*a);
System.out.println("xl = " + xl + "\nx2 = " + x2);
>
20/44