Created
February 20, 2020 01:26
-
-
Save SOS77777/8fdccb69dbf2f78bf1c209fded633b7a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int a [3][3] , results1 , results2 , results3 , result , b[2][2] , many , type1 , type2 , result44, second , second2 , h[2][2] , m[3][3] , h3 , h1 , h2 ; | |
int x , x1 , x2 , x3 = 0 ; | |
float asdmoha ; | |
cout<<"please Enter your many MATRIX what do you want solve"<<endl ; | |
cin>>many; | |
cout<<"please Enter your FRIST type from your matrix "<<endl ; | |
cin>>type1; | |
cout<<"please Enter your second type from your matrix "<<endl ; | |
cin>>type2; | |
if(many == 2 && ((type1 == 3)||(type1 == 2)) && ((type2 == 2) || (type2 == 3))){ | |
cout<<"Enter the first MATRIX from type third"<<endl ; | |
std::cin >> a[0][1]>>a[0][2]>>a[0][3] ; | |
std::cin >> a[1][1]>>a[1][2]>>a[1][3] ; | |
std::cin >> a[2][1]>>a[2][2]>>a[2][3] ; | |
results1 = (a[0][1]) * ((a[1][3] * a[2][2]) - (a[1][2] * a[2][3])); | |
cout<<"results1 : "<<results1<<endl; | |
results2= (a[0][2]) * ((a[1][3] * a[2][1]) - (a[1][1] * a[2][3])); | |
cout<<"results2:"<<results2<<endl; | |
results3 =(a[0][3]) * ((a[1][2] * a[2][1]) - (a[1][1] * a[2][2])); | |
cout<<"result3 :"<<results3<<endl; | |
result = results3 - results2 + results1 ; | |
cout<<"the result is "<<result<<endl ; | |
//cout<<"the finally result : "<<result<<endl; | |
cout<<"Enter your second MATRIX from type second"<<endl ; | |
cin >> b[0][1] >> b[0][2]; | |
cin >> b[1][1] >> b[1][2]; | |
second = b[0][2] * b[1][1] - b[0][1] * b[1][2] ; | |
cout<<"the result from type two "<<second<<endl; | |
int finally = second * result ; | |
} | |
else if(many == 2 && ((type1 == 3) || (type2 == 3))){ | |
cout<<"Enter your MATRIX from type third"<<endl ; | |
std::cin >> a[0][1]>>a[0][2]>>a[0][3] ; | |
std::cin >> a[1][1]>>a[1][2]>>a[1][3] ; | |
std::cin >> a[2][1]>>a[2][2]>>a[2][3] ; | |
results1 = (a[0][1]) * ((a[1][3] * a[2][2]) - (a[1][2] * a[2][3])); | |
cout<<"results1 : "<<results1<<endl; | |
results2= (a[0][2]) * ((a[1][3] * a[2][1]) - (a[1][1] * a[2][3])); | |
cout<<"results2:"<<results2<<endl; | |
results3 =(a[0][3]) * ((a[1][2] * a[2][1]) - (a[1][1] * a[2][2])); | |
cout<<"result3 :"<<results3<<endl; | |
result = results3 - results2 + results1 ; | |
cout<<result; | |
cout<<"Enter your MATRIX from type third the twice" ; | |
std::cin >> m[0][1]>>m[0][2]>>m[0][3] ; | |
std::cin >> m[1][1]>>m[1][2]>>m[1][3] ; | |
std::cin >> m[2][1]>>m[2][2]>>m[2][3] ; | |
h1 = (m[0][1]) * ((m[1][3] * m[2][2]) - (m[1][2] * m[2][3])); | |
cout<<"resultshhhhh1 : "<<h1<<endl; | |
h2= (m[0][2]) * ((m[1][3] * m[2][1]) - (m[1][1] * m[2][3])); | |
cout<<"resultshhhhh2:"<<h2<<endl; | |
h3 =(m[0][3]) * ((m[1][2] * m[2][1]) - (m[1][1] * m[2][2])); | |
cout<<"resulthhhhh3 :"<<h3<<endl; | |
asdmoha = h3 - h2 + h1 ; | |
cout<<h ; | |
} | |
else if(many == 2 && ((type1 == 2)||(type1 == 2)) && ((type2 == 2) || (type2 == 2))){ | |
cout<<"Enter your second MATRIX from type second"<<endl ; | |
cin >> b[0][1] >> b[0][2]; | |
cin >> b[1][1] >> b[1][2]; | |
int second = b[0][2] * b[1][1] - b[0][1] * b[1][2] ; | |
cout<<"Enter your second MATRIX from type second the twice "<<endl ; | |
cin >> h[0][1] >> h[0][2]; | |
cin >> h[1][1] >> h[1][2]; | |
second2 = h[0][2] * h[1][1] - h[0][1] * h[1][2] ; | |
result44 = second - second2 ; | |
cout<<result44 ; | |
} | |
else if((many == 1) && ((type1 == 2) && (type2 == 2 ))){ | |
cout<<"Enter your MATRIX from type2 second"<<endl ; | |
cin >> b[0][1] >> b[0][2]; | |
cin >> b[1][1] >> b[1][2]; | |
int second = b[0][2] * b[1][1] - b[0][1] * b[1][2] ; | |
cout<<second; | |
} | |
else if(many == 1 && (type1 == 3) || (type2 == 3)){ | |
cout<<"Enter your MATRIX from type third"<<endl ; | |
std::cin >> a[0][1]>>a[0][2]>>a[0][3] ; | |
std::cin >> a[1][1]>>a[1][2]>>a[1][3] ; | |
std::cin >> a[2][1]>>a[2][2]>>a[2][3] ; | |
results1 = (a[0][1]) * ((a[1][3] * a[2][2]) - (a[1][2] * a[2][3])); | |
cout<<"results1 : "<<results1<<endl; | |
results2= (a[0][2]) * ((a[1][3] * a[2][1]) - (a[1][1] * a[2][3])); | |
cout<<"results2:"<<results2<<endl; | |
results3 =(a[0][3]) * ((a[1][2] * a[2][1]) - (a[1][1] * a[2][2])); | |
cout<<"result3 :"<<results3<<endl; | |
result = results3 - results2 + results1 ; | |
cout<<"the finally result : " <<result; | |
}else{ | |
cout<<"naugthy boy" ; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment