welcome tinhocK1 website

Friday, 26/04/2024, 2:14 AM

Chào Guest

Login form

Đăng nhập:
mật khẩu:

Ẩn

Tán Gẫu

500

Bạn thấy web tinhoc K1 thế nào?

Rate my site
Total of answers: 108
[ New messages · Members · Forum rules · Search · RSS ]
  • Page 1 of 1
  • 1
Forum » download » tài liệu chuyên ngành » giai pt
giai pt
quocdat11 Date: Sunday, 02/11/2008, 2:32 PM | Message # 1
Nhóm: Removed





#include
#include
#include
int ptb1(float a,float b)
{ float x;
if(a == 0){
if(b == 0)
cout<<"phuong trinh vo so nghiem: ";
else
cout<<"phuong trinh vo nghiem: ";
}
else{x=-b/a;
cout<<"phuong trinh co nghiem:x= "<< x; }
return 0;

}
int ptb2(float a,float b,float c)
{ float d,x1,x2;
if(a == 0)
ptb1(b,c);
else { (d=(b*b)-(4*a*c));
if (d <0)
{ cout<<"phuong trinh vo nghiem: ";}

else if(d == 0)
{ x1=-b/(2*a);
cout<<"phuong trinh co nghiem kep: "<< x1;}
else{
x1=(-b+sqrt(d))/(2*a);
x2=(-b-sqrt(d))/(2*a);
cout<<"phuong trinh co 2 nghiem: "<< endl;
cout<<"x1= "< cout<<"x2= "< return 0;
}
}
}
int main() {

float a,b,c;
clrscr();
cout<<"nhap he so a= ";
cin>>a;
cout <<"nhap he so b= ";
cin>>b;
cout<<"nhap he so c= ";
cin>>c;
ptb2(a,b,c);
getch();
return 0;

}

 
Forum » download » tài liệu chuyên ngành » giai pt
  • Page 1 of 1
  • 1
Search: