Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- int main()
- {
- float a,b,c,d,e,f,x,y,Wx,Wy,W;
- printf("Podaj wspolczynniki: \n a:");
- scanf("%f", &a);
- printf("\n b:");
- scanf("%f", &b);
- printf("\n c:");
- scanf("%f", &c);
- printf("\n d:");
- scanf("%f", &d);
- printf("\n e:");
- scanf("%f", &e);
- printf("\n f:");
- scanf("%f", &f);
- Wx=(c*e)-(f*b);
- Wy=(a*f)-(c*d);
- W=(a*e)-(d*b);
- x=(Wx/W);
- y=(Wy/W);
- if (W!=0.0) { printf("Ukl. rownan ma 1 pare rozwiazan postaci: x=%f",x);
- printf("oraz y=%f",y); }
- if (W==0.0 && Wx==0.0 && Wy==0.0) { printf("Uklad jest nieoznaczony"); }
- if (W==0.0 && (Wx!=0.0 || Wy!=0.0)) { printf("Uklad jest sprzeczny"); }
- system("PAUSE");
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement