Dekuji za radu, ale nejak se mi to nedari implementovat.
Ukazi svuj kod:
import java.util.*;
public class LinearniRovnice {
public static void main(String[] arg) {
Scanner sc = new Scanner(System.in);
System.out.print("Zadej a: ");
double a = sc.nextInt();
System.out.print("Zadej b: ");
double b = sc.nextInt();
double x;
if ( a==0 & b==0){
System.out.println("Rovnice: 0 * x + 0 = 0");
System.out.println("ma nekonecne mnoho reseni");
}
else{
if (a==0){
System.out.println("Rovnice: 0 * x + 1 = 0");
System.out.println("nema reseni");
}
else{
x=-b/a;
System.out.println("Rovnice: "+a+" * x + "+b+" = 0" );
System.out.println("ma reseni x = "+x+"");
}
}
}
}
Děkuji za radu.