Polecenie :
Napisz program na podstawie podanego algorytmu.
algorytm w załączniku.
50pkt za pomoc!!!
czekam na odp.
#include <cstdlib>#include <iostream>
using namespace std;
int main(int argc, char *argv[]){
float a1,b1,c1,a2,b2,c2,W,Wx,Wy,x,y; cout.precision(2); cin>>a1>>b1>>c1>>a2>>b2>>c2;
W=(a1*b2)-(a2*b1); Wx=(c1*b2)-(c2*b1); Wy=(a1*c2)-(a2*c1); x=Wx/W; y=Wy/W; if(W!=0)cout<<fixed<<x<<" "<<y; else if(W==0&&(Wx!=0||Wy!=0))cout<<fixed<<"brak"; else if(W==0&&Wx==0&&Wy==0)cout<<fixed<<"nwr"; cout<<endl;
system("PAUSE"); return EXIT_SUCCESS;}
" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
float a1,b1,c1,a2,b2,c2,W,Wx,Wy,x,y;
cout.precision(2);
cin>>a1>>b1>>c1>>a2>>b2>>c2;
W=(a1*b2)-(a2*b1);
Wx=(c1*b2)-(c2*b1);
Wy=(a1*c2)-(a2*c1);
x=Wx/W;
y=Wy/W;
if(W!=0)cout<<fixed<<x<<" "<<y;
else if(W==0&&(Wx!=0||Wy!=0))cout<<fixed<<"brak";
else
if(W==0&&Wx==0&&Wy==0)cout<<fixed<<"nwr";
cout<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}