herrDeng網內搜尋

自訂搜尋

Ads

2011年3月17日 星期四

解一元二次方程式

解一元二次方程式

ax^2+bx+c=0, x=?

46 則留言:

b9633038 提到...

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);
}
}

b9613128 提到...

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);
}


}

B9933100 提到...

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);
}
}

B9933061 提到...

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);
}
}

B9733202 提到...

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);
}
}

b9933076 提到...

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);
*/
}

}

B9933068 提到...

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);

}
}

B9933102 提到...

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);
}
}

B9933101 提到...

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);
}
}

B9933065 提到...

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);
}
}

B9933066 提到...

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);
}
}

B9933098 提到...

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);
*/
}

}

B9933075 提到...

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);
}
}

B9933108 提到...

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);

}
}

B9933106 提到...

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);
}
}

B9933098 提到...

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);

}

}

B9933116 提到...

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);

}
}

B9933103 提到...

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);

}

}

B9933072 提到...

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);
}
}

B9933072 提到...

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);
}
}

B9933085 提到...

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) ;
}
}

B9933092 提到...

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);
}
}

b9933070 提到...

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);
}
}

b9933076 提到...

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);
}
}

b9933090 提到...

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);
}
}

B9833034 提到...

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);


}
}

B9933074 提到...

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);
}
}
}
}

b9933097 提到...

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);
}
}

b9933110 提到...

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);
}
}

B9933063 提到...

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);
}
}

B9933071 提到...

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);
}
}

B9933109 提到...

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);
}
}

B9933069 提到...

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);
}
}

a9933056 提到...

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);
}
}

A9933059 提到...

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);
}
}

b9933099 提到...

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);
}
}

A9933058 提到...

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);
}
}

b9933114 提到...

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);
}
}

b9933110 提到...

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);
}
}

B9933064 提到...

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);
}
}

B9933078 提到...

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);
}
}

B9933073 提到...

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);
}
}

b9933094 提到...

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);
}
}

b9933079 提到...

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);
}
}

b9933079 提到...

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);
}
}

b9933093 提到...

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);
}
}

Related Posts Plugin for WordPress, Blogger...

熱門文章