Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- double a1,b1,c1,a2,b2,c2,w,wx,wy,x,y;
- cout<<"Podaj a1: ";
- cin>>a1;
- cout<<"Podaj b1: ";
- cin>>b1;
- cout<<"Podaj c1: ";
- cin>>c1;
- cout<<"Podaj a2: ";
- cin>>a2;
- cout<<"Podaj b2: ";
- cin>>b2;
- cout<<"Podaj c2: ";
- cin>>c2;
- w= a1*b2-b1*a2;
- wx= c1*b2-b1*c2;
- wy= a1*c2-c1*a2;
- if(w!=0)
- {
- x=wx/w;
- y=wy/w;
- cout<<x,y;
- }
- else
- if(wx==0 && wy==0)
- {
- cout<<"Uklad ma nieskonczenie wiele rozwiazan";
- }
- else
- cout<<"Uklad sprzeczy - nie ma rozwiazan";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement