System.out.print("please key a="); int a=input.nextInt(); System.out.print("please key b="); int b=input.nextInt(); System.out.print("please key c="); int c=input.nextInt();
import java.util.*; class qq { public static void main (String[] arg) { int a,b,c; Scanner input = new Scanner(System.in); System.out.println("輸入a"); a = input.nextInt(); System.out.println("輸入b"); b = input.nextInt(); System.out.println("輸入c"); c = input.nextInt(); float d = b*b - 4*a*c; String s="判別式"; System.out.println(a+"x^2+"+b+"x+"+c+"=0"+s+"="+d); if (d<0) { System.out.println(s+"<0"); return; } double k,m,n; System.out.println(Math.sqrt((float)d)); k = Math.sqrt((float)d); m = (-b+k)/(a*2); n = (-b-k)/(a*2); System.out.println("方程式解為"+m+"和"+n); } }
46 則留言:
import java.util.*;
class smile
{
public static void main(String [] argv)
throws Exception
{
Scanner input=new Scanner(System.in);
int a=input.nextInt();
int b=input.nextInt();
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
double d2 = Math.sqrt(d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if(d<=0)
{
System.out.println(s+"<0");
return;
}
System.out.println(Math.sqrt((float)d));
System.out.println(d<8.);
System.out.println("x1="+x1+",x2="+x2);
}
}
import java.util.*;
class qq{
public static void main(String [] argv)
throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("please key a=");
int a=input.nextInt();
System.out.print("please key b=");
int b=input.nextInt();
System.out.print("please key c=");
int c=input.nextInt();
float d = b*b - 4*a*c;
String s ="判別式";
double d2 = Math.sqrt(d);
double x1 = (-b + d2) / (2*a);
double x2 = (-b - d2) / (2*a);
System.out.println(a+"x^2+"+b+"x+"+c+"=0"+s+"="+d);
if(d<0)
{
System.out.println(s+"<0");
return;
}
System.out.println(Math.sqrt((float)d));
System.out.println("x1="+x1+",x2="+x2);
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if(d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((float)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.print(x1);
System.out.print(x2);
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2"+b+"x+"+c+s+d);
if(d<0)
{System.out.println(s+"<0");
return;
}
double d2=Math.sqrt(d);
double X1=(-b+d2)/(2*a);
double X2=(-b-d2)/(2*a);
System.out.println(X1);
System.out.println(X2);
}
}
import java.util.*;
class qq
{
public static void main (String[] arg)
{
int a,b,c;
Scanner input = new Scanner(System.in);
System.out.println("輸入a");
a = input.nextInt();
System.out.println("輸入b");
b = input.nextInt();
System.out.println("輸入c");
c = input.nextInt();
float d = b*b - 4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+"=0"+s+"="+d);
if (d<0)
{
System.out.println(s+"<0");
return;
}
double k,m,n;
System.out.println(Math.sqrt((float)d));
k = Math.sqrt((float)d);
m = (-b+k)/(a*2);
n = (-b-k)/(a*2);
System.out.println("方程式解為"+m+"和"+n);
}
}
import java.util.*;
class qq
{
public static void main (String[]arg)throws Exception
{
int a,b,c;
Scanner input=new Scanner(System.in);
System.out.print("a=");
a=input.nextInt();
System.out.print("b=");
b=input.nextInt();
System.out.print("c=");
c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if (d<0)
{System.out.println(s+"<0以後都不");
return;
}
System.out.println(Math.sqrt((float)d));
/* float d2=math.sqrt(d);
x1=(-b+d2)/(2*a);
x2=(-b-d2)/(2*a);
*/
}
}
import java.util.*;
class qq
{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2"+b+"x+"+c+s+d);
if (d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((float)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.println(x1);
System.out.println(x2);
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2"+b+"x+"+c+s+d);
if(d<0)
{System.out.println(s+"<0");
return;
}
double d2=Math.sqrt(d);
double X1=(-b+d2)/(2*a);
double X2=(-b-d2)/(2*a);
System.out.println(X1);
System.out.println(X2);
}
}
import java.util.*;
class qq
{
public static void main(String[]arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("");
int a,b,c;
System.out.print("a=");
a=input.nextInt();
System.out.print("b=");
b=input.nextInt();
System.out.print("c=");
c=input.nextInt();
double d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+"x+"+c+s+d);
if(d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((double)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.print(x1);
System.out.print(x2);
}
}
import java.util.*;
class qq
{
public static void main (String [] arg) throws Exception
{
int a,b,c;
Scanner input=new Scanner(System.in);
System.out.print("a=");
a=input.nextInt();
System.out.print("b=");
b=input.nextInt();
System.out.print("c=");
c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2"+b+"x+"+c+s+"="+d);
if (d<0)
{
System.out.println(s+"<0");
return;
}
System.out.println(Math.sqrt((float)d));
double d2=Math.sqrt(d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.println(x1);
System.out.println(x2);
}
}
import java.util.*;
class qq
{
public static void main (String [] arg)throws Exception
{
int a,b,c;
Scanner input=new Scanner(System.in);
System.out.print ("a=");
a=input.nextInt();
System.out.print("b=");
b=input.nextInt();
System.out.print("c=");
c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+"="+d);
if(d<0)
{
System.out.println(s+"<0");
return;
}
System.out.println(Math.sqrt((float)d));
double d2=Math.sqrt(d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.println(x1);
System.out.println(x2);
}
}
import java.util.*;
class qq
{
public static void main (String[]arg)throws Exception
{
int a,b,c;
Scanner input=new Scanner(System.in);
System.out.print("a=");
a=input.nextInt();
System.out.print("b=");
b=input.nextInt();
System.out.print("c=");
c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if (d<0)
{System.out.println(s+"<0以後都不");
return;
}
System.out.println(Math.sqrt((float)d));
/* float d2=math.sqrt(d);
double d2=Math.sqrt(d);
double X1=(-b+d2)/(2*a);
double X2=(-b-d2)/(2*a);
System.out.println(X1);
System.out.println(X2);
*/
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2"+b+"x+"+c+s+d);
if(d<0)
{System.out.println(s+"<0");
return;
}
double d2=Math.sqrt(d);
double X1=(-b+d2)/(2*a);
double X2=(-b-d2)/(2*a);
System.out.println(X1);
System.out.println(X2);
}
}
import java.util.*;
class qq
{
public static void main (String[]arg)throws Exception
{
int a,b,c;
Scanner input=new Scanner(System.in);
System.out.print ("a=");
a=input.nextInt();
System.out.print ("b=");
b=input.nextInt();
System.out.print ("c=");
c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
System.out.println(Math.sqrt((float)d));
System.out.println(d!=25);
if(d<0)
{
System.out.println(s+"<0");
return;
}
System.out.println(Math.sqrt((float)d));
double d2=Math.sqrt(d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.println(x1);
System.out.println(x2);
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("a=");
int a=input.nextInt();
System.out.print("b=");
int b=input.nextInt();
System.out.print("c=");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2"+b+"x+"+c+s+d);
if(d<0)
{System.out.println(s+"<0");
return;
}
double d2=Math.sqrt(d);
double X1=(-b+d2)/(2*a);
double X2=(-b-d2)/(2*a);
System.out.println(X1);
System.out.println(X2);
}
}
import java.util.*;
class qq
{
public static void main (String[]arg)throws Exception
{
int a,b,c;
Scanner input=new Scanner(System.in);
System.out.print("a=");
a=input.nextInt();
System.out.print("b=");
b=input.nextInt();
System.out.print("c=");
c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if (d<0)
{System.out.println(s+"<0以後都不");
return;
}
System.out.println(Math.sqrt((float)d));
double d2=Math.sqrt(d);
double X1=(-b+d2)/(2*a);
double X2=(-b-d2)/(2*a);
System.out.println(X1);
System.out.println(X2);
}
}
import java.util.*;
class qq
{
public static void main(String [] arg) throws Exception
{
int a, b, c;
Scanner input=new Scanner(System.in);
System.out.print("a=");
a=input.nextInt();
System.out.print("b=");
b=input.nextInt();
System.out.print("c=");
c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+"="+d);
if (d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt(d);
double X1=(-b+d2)/(2*a);
double X2=(-b-d2)/(2*a);
System.out.println(X1);
System.out.println(X2);
}
}
import java.util.*;
class qq
{
public static void main (String[]arg)throws Exception
{
int a,b,c;
Scanner input=new Scanner(System.in);
System.out.print("a=");
a=input.nextInt();
System.out.print("b=");
b=input.nextInt();
System.out.print("c=");
c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if (d<0)
{System.out.println(s+"<0以後都不");
return;
}
System.out.println(Math.sqrt((float)d));
double d2=Math.sqrt(d);
double X1=(-b+d2)/(2*a);
double X2=(-b-d2)/(2*a);
System.out.println(X1);
System.out.println(X2);
}
}
import java.util.*;
class qq
{
public static void main(String[]arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("");
int a,b,c;
System.out.print("a=");
a=input.nextInt();
System.out.print("b=");
b=input.nextInt();
System.out.print("c=");
c=input.nextInt();
double d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+"x+"+c+s+d);
if(d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((double)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.print(x1);
System.out.print(x2);
}
}
import java.util.*;
class qq
{
public static void main(String[]arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("");
int a,b,c;
System.out.print("a=");
a=input.nextInt();
System.out.print("b=");
b=input.nextInt();
System.out.print("c=");
c=input.nextInt();
double d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+"x+"+c+s+d);
if(d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((double)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.print(x1);
System.out.print(x2);
}
}
import java.util.*;
class qq
{
public static void main(String [] arg)throws Exception
{ int a,b,c;
Scanner input=new Scanner(System.in);
System.out.print("a=");
a=input.nextInt();
System.out.print("b=");
b= input.nextInt();
System.out.print("c=");
c= input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if (d<0)
{System.out.println(s+"<0");
return;
}
System.out.println(Math.sqrt((float)d));
double d2=Math.sqrt(d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.println(x1) ;
System.out.println(x2) ;
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2"+b+"x+"+c+s+d);
if(d<0)
{System.out.println(s+"<0");
return;
}
double d2=Math.sqrt(d);
double X1=(-b+d2)/(2*a);
double X2=(-b-d2)/(2*a);
System.out.println(X1);
System.out.println(X2);
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2"+b+"x+"+c+s+d);
if(d<0)
{System.out.println(s+"<0");
return;
}
double d2=Math.sqrt(d);
double X1=(-b+d2)/(2*a);
double X2=(-b-d2)/(2*a);
System.out.println(X1);
System.out.println(X2);
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2"+b+"x+"+c+s+d);
if(d<0)
{System.out.println(s+"<0");
return;
}
double d2=Math.sqrt(d);
double X1=(-b+d2)/(2*a);
double X2=(-b-d2)/(2*a);
System.out.println(X1);
System.out.println(X2);
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2"+b+"x+"+c+s+d);
if(d<0)
{System.out.println(s+"<0");
return;
}
double d2=Math.sqrt(d);
double X1=(-b+d2)/(2*a);
double X2=(-b-d2)/(2*a);
System.out.println(X1);
System.out.println(X2);
}
}
import java.util.*;
class qq
{
public static void main(String[] arg)throws Exception
{
int a,b,c;
Scanner input=new Scanner(System.in);
System.out.print("a=");
a=input.nextInt();
System.out.print("b=");
b=input.nextInt();
System.out.print("c=");
c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x"+c+s+d);
if (d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((float)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.println(x1);
System.out.println(x2);
}
}
import java.util.*;
class qq
{
public static void main (String [] arg)
{
int a,b,c;
Scanner input =new Scanner (System.in);
System.out.print("輸入a=");
a= input.nextInt();
System.out.print("輸入b=");
b= input.nextInt();
System.out.print("輸入c=");
c= input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if (d<0)
{
System.out.println(s+"<0");
return;
{
System.out.println(Math.sqrt((float)d));
double d2=Math.sqrt(d);
double x1=(-d+d2)/(2*a);
double x2=(-d-d2)/(2*a);
System.out.println(x1);
System.out.println(x2);
}
}
}
}
import java.util.*;
class qq
{
public static void main(String [] arg)throws Exception
{
int a,b,c;
Scanner input=new Scanner(System.in);
System.out.print("a=");
a=input.nextInt();
System.out.print("b=");
b=input.nextInt();
System.out.print("c=");
c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if (d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((float)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.println(x1);
System.out.println(x2);
}
}
import java.util.*;
class qq
{
public static void main(String[]arg)throws Exception
{
int a,b,c;
Scanner input =new Scanner(System.in);
System.out.print("a=");
a= input.nextInt();
System.out.print("b=");
b= input.nextInt();
System.out.print("c=");
c= input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+"0"+s+"="+d);
if(d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sprt((float)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.println(x1);
System.out.println(x2);
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if(d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((float)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.print(x1);
System.out.print(x2);
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2"+b+"x+"+c+s+d);
if(d<0)
{System.out.println(s+"<0");
return;
}
double d2=Math.sqrt(d);
double X1=(-b+d2)/(2*a);
double X2=(-b-d2)/(2*a);
System.out.println(X1);
System.out.println(X2);
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if(d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((float)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.print(x1);
System.out.print(x2);
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if(d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((float)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.print(x1);
System.out.print(x2);
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if(d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((float)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.print(x1);
System.out.print(x2);
}
}
import java.util.*;
class qq
{
public static void main(String[]arg)throws Exception
{
int a,b,c;
Scanner input =new Scanner(System.in);
System.out.print("a=");
a= input.nextInt();
System.out.print("b=");
b= input.nextInt();
System.out.print("c=");
c= input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+"0"+s+"="+d);
if(d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sprt((float)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.println(x1);
System.out.println(x2);
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2"+b+"x+"+c+s+d);
if(d<0)
{System.out.println(s+"<0");
return;
}
double d2=Math.sqrt(d);
double X1=(-b+d2)/(2*a);
double X2=(-b-d2)/(2*a);
System.out.println(X1);
System.out.println(X2);
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if(d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((float)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.print(x1);
System.out.print(x2);
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if(d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((float)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.print(x1);
System.out.print(x2);
}
}
import java.util.*;
class qq
{
public static void main(String[]arg)throws Exception
{
int a,b,c;
Scanner input =new Scanner(System.in);
System.out.print("a=");
a= input.nextInt();
System.out.print("b=");
b= input.nextInt();
System.out.print("c=");
c= input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+"0"+s+"="+d);
if(d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((float)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.println(x1);
System.out.println(x2);
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if(d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((float)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.print(x1);
System.out.print(x2);
}
}
import java.util.*;
class qq
{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if (d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((float)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.print(x1);
System.out.print(x2);
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if(d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((float)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.print(x1);
System.out.print(x2);
}
}
import java.util.*;
class java {
public static void main(String[]arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System .out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if(d>0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((float)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.print(x1);
System.out.print(x2);
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if(d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((float)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.print(x1);
System.out.print(x2);
}
}
import java.util.*;
class java{
public static void main(String [] arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if(d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((float)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.print(x1);
System.out.print(x2);
}
}
import java.util.*;
class qq{
public static void main(String[]arg)throws Exception
{
Scanner input=new Scanner(System.in);
System.out.print("輸入a");
int a=input.nextInt();
System.out.print("輸入b");
int b=input.nextInt();
System.out.print("輸入c");
int c=input.nextInt();
float d=b*b-4*a*c;
String s="判別式";
System.out.println(a+"x^2+"+b+"x+"+c+s+d);
if(d<0)
{
System.out.println(s+"<0");
return;
}
double d2=Math.sqrt((float)d);
double x1=(-b+d2)/(2*a);
double x2=(-b-d2)/(2*a);
System.out.print(x1);
System.out.print(x2);
}
}
張貼留言