[C++] code giải hệ phương trình bậc nhất

HuanBuiThanh
 code giải hệ phương trình bậc nhất trong C/C++
#include
#include
#includevoid main()
{
clrscr();
float a1,a2,b1,b2,c1,c2,D,Dx,Dy,x,y;
int i;
printf("\n --------------------------------------") ;

printf("\n chuong trinh giai he pt bac nhat : HuanBuiThanh ") ;

printf("\n ---------------------------------------") ;

printf("\nXin hay nhap gia tri a1= ") ; scanf("%f",&a1);

printf("\nXin hay nhap gia tri b1= ") ; scanf("%f",&b1);

printf("\nXin hay nhap gia tri c1= ") ; scanf("%f",&c1);

printf("\nXin hay nhap gia tri a2= ") ; scanf("%f",&a2);

printf("\nXin hay nhap gia tri b2= ") ; scanf("%f",&b2);

printf("\nXin hay nhap gia tri c2= ") ; scanf("%f",&c2);

if((a1*a1)+(b1*b1)!=0 && (a2*a2)+(b2*b2)!=0)

{

D=a1*b2-a2*b1;

Dx=c1*b2-c2*b1;

Dy=a1*c2-a2*c1;

if(D!=0) printf("\nphuong trinh co nghiem duy nhat trong do: x= %3.2f va y= %3.2f",Dx/D,Dy/D);

if(D==0)

{

if(Dx!=0 && Dy!=0) printf("\nPhuong trinh vo nghiem");

else if(Dx==0 && Dy==0) printf("\nPhuong trinh vo so nghiem");

}

}

getch();

}

Getting Info...

3 nhận xét

  1. cám ơn bạn nhiều
  2. Giải ngu vcl ra
  3. Ngu mà thích thể hiện .. về học toán lại đi rồi hẵng nói tiếp nha
Cảm ơn bạn đã quan tâm và gửi nhận xét tại
http://huanbuithanh.blogspot.com
hãy ghé thăm blog hàng ngày để được cập nhật những thủ thuật mới nhất nhé . thân ái !
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.