package funkcja;
import java.io.IOException;
import java.util.InputMismatchException;
import java.util.Scanner;
public class Funckja {
{ boolean in = true;
int a;
int b;
int c;
double d;
double x;
double x1;
double x2;
Scanner odczyt
= new Scanner
(System.
in);
do{
try {
System.
out.
print("Podaj pierwsza liczbe: ");
a = odczyt.nextInt();
System.
out.
print("Podaj druga liczbe: ");
b = odczyt.nextInt();
System.
out.
print("Podaj trzecia liczbe: ");
c = odczyt.nextInt();
d
= (Math.
pow(b,
2))-(4*a
*c
);
if(d>0)
{
x1
= (-b
-Math.
sqrt(d
))/(2*a
);
x2
= (-b
+Math.
sqrt(d
))/(2*a
);
System.
out.
print("Delta wynosi: "+d
+" "+"Funkcja ma dwa miejsca zerowe: "+x1
+" "+x2
);
in = false;
}
else if(d==0)
{x = (-b)/(2*a);
System.
out.
print("Delta wynosi: "+d
+" "+"Funkcja ma jedno miejsce zerowe: "+ x
);
in = false;
}
else if(d<0)
{
System.
out.
print("Delta wynosi: "+d
+" "+"Brak miejsc zerowych");
in = false;
}
} catch (InputMismatchException Ie) {
System.
err.
print("Wprowadz liczbe calkowita");
odczyt.nextLine();
System.
out.
println("Wprowadz ponowinie dane");
}
System.
err.
print("Wprowadz liczbe calkowita");
odczyt.close();
System.
out.
println("Wprowadz ponowinie dane");
}
}
while(in);
odczyt.close();
}
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}