Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» NewBlueFx TotalFX Windows-FL | 1.11 GB
Tue Dec 17, 2013 12:42 pm by titquarra

» NewBlueFx TotalFX Windows-FL | 1.11 GB
Tue Dec 17, 2013 12:42 pm by titquarra

» Celebrity.Sex.Tape.UNCUT.&.UNRATED.2012.720p.BRrip.x264.YIFY.mp4
Tue Dec 17, 2013 8:32 am by titquarra

» Maya Autodesk Personal Learning Edition 8.5
Tue Dec 17, 2013 7:47 am by titquarra

» Tuyệt Kỹ Đong Giai Chân Kinh (tuyệt Kỹ cua trai)
Thu Aug 23, 2012 5:38 am by Admin

» Tuyệt kỹ cua giai
Thu Aug 23, 2012 5:36 am by Admin

» NETCAT.........
Mon Aug 13, 2012 6:35 am by Admin

» Bảo mật CSDL bằng phương pháp mã hóa.
Tue Apr 17, 2012 10:04 pm by Admin

» Hàm mã hóa MD5 bằng JavaScript
Tue Apr 17, 2012 10:03 pm by Admin

Shopmotion


Affiliates
free forum


Giải phương trình bậc 2 ax2 + bx +c=0

View previous topic View next topic Go down

Giải phương trình bậc 2 ax2 + bx +c=0

Post  Admin on Sun May 22, 2011 10:49 pm

package IO;

public class PTB2 {
private double a;
private double b;
private double c;
private double delta;
public PTB2(){
a=0.0;
b=0.0;
c=0.0;
delta=0.0;
}

public PTB2(double aa,double bb,double cc){
this.a=aa;
this.b=bb;
this.c=cc;

}
void solve(){
if(a==0)
{

PTB1 pt=new PTB1(b,c);
pt.solve();
}
else
{

delta=b*b-4*a*c;
if(delta<0)
System.out.print("PTVN");
else
{
System.out.print("x1="+(-b+Math.sqrt(delta))/(2*a));
System.out.print(" x2="+(-b-Math.sqrt(delta))/(2*a));
}


}
}


/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
PTB2 pt=new PTB2(2,4,1);
pt.solve();
}

}

Admin
Admin

Tổng số bài gửi : 782
Join date : 2009-08-15

View user profile http://hackis.forumotion.com

Back to top Go down

Re: Giải phương trình bậc 2 ax2 + bx +c=0

Post  Admin on Sun May 22, 2011 10:50 pm

void solve(){
if(a==0)
if(b==0)
System.out.print("PTVSN");
else
System.out.print("PTVN");
else
System.out.print(""+(-b/a));
}

Admin
Admin

Tổng số bài gửi : 782
Join date : 2009-08-15

View user profile http://hackis.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum