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(int argc, char *argv[])
- {
- double x,y;
- double a,aa,b,bb,c,cc;
- double w,wx,wy;
- printf("c=a*x+b*y\n");
- printf("cc=aa*x+bb*y\n");
- printf("Podaj c\n");
- scanf("%lf",&c);
- printf("Podaj a\n");
- scanf("%lf",&a);
- printf("Podaj b\n");
- scanf("%lf",&b);
- printf("Podaj cc\n");
- scanf("%lf",&cc);
- printf("Podaj aa\n");
- scanf("%lf",&aa);
- printf("Podaj bb\n");
- scanf("%lf",&bb);
- w=a*bb-b*aa;
- wx=c*bb-b*cc;
- wy=a*cc-c*aa;
- printf("przed\n");
- printf("w= %lf\n",w);
- printf("wx= %lf\n",wx);
- printf("wy= %lf\n",wy);
- printf("po\n");
- if(w!=0)
- {
- x=wx/w;
- y=wy/w;
- printf("w= %lf\n",w);
- printf("wx= %lf\n",wx);
- printf("wy= %lf\n",wy);
- printf("x= %lf\n",x);
- printf("y= %lf\n",y);
- }
- else
- {
- if(w==0 && wx==0 && wy==0)
- {
- printf("Istnieje nieskonczona ilosc rozwiazan\n");
- }
- if(w==0 && wx!=0 && wy!=0)
- {
- printf("Nie istnieja rozwiazania\n");
- }
- }
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement