kiem tien, kiem tien online, kiem tien truc tuyen, kiem tien tren mang
Friday, September 26, 2014

///giải hệ phương trình 2 ẩn trong lập trình c
#include<stdio.h>
#include<conio.h>
void main()
{
float a1, b1, c1, a2, b2, c2, d, dx, dy;
printf("nhap vao cac he so cua phuong trinh 1:a1,b1,c1\n");
scanf_s("%f%f%f", &a1, &b1, &c1);
printf("nhap vao cac he so cua phuong trih 2:a2,b2,c2 \n");
scanf_s("%f%f%f", &a2, &b2, &c2);
d = a1*b2 - a2*b1;
dx = c1*b2 - c2*b1;
dy = a1*c2 - a2*c1;
if (d == 0)
{
if ((dx == 0) && (dy == 0)) printf("he vo so nghiem");
else printf("he vo nghiem");
}
else
{
printf("x=%.2f\n", dx / d);
printf("y=%.2f\n", dy / d);
}
_getch();

}

0 comments:

Post a Comment

domain, domain name, premium domain name for sales

Popular Posts