Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- float a1;
- float b1;
- float c1;
- float a2;
- float b2;
- float c2;
- float W;
- float X;
- float Y;
- float m;
- float n;
- //--------
- string one;
- string two;
- //--------
- int main()
- {
- cout << "1. Algorytm oblicza układ równań metodą wyznacznikową" << endl;
- cout << "2. Program nie obsługuje znaków matematycznych, tylko liczby" << endl;
- cout << "3. Jako przecinków w liczbach dziesiętnych używaj KROPEK" << endl;
- cout << "4. Aby zapisać mnożenie użyj GWIAZDKI, żeby zapisać potęgę użyj ^x, żeby dzielić użyj /" << endl;
- cout << "5. Po uzupełnieniu każdego pola i upewnieniu się że pole jest poprawnie wypełnione naciśnij ENTER"<< endl<< endl;
- cout << "Po zapoznaniu się z instrukcjami naciśnij ENTER" <<endl <<endl;
- cin.get();
- cout << "================================================"<<endl<<endl;
- cout << "Uzupełnij równanie"<<endl<<endl;
- cout << "#1 ,- ";
- cin >> one;
- cout << " |"<<endl;
- cout << " {"<<endl;
- cout << " |"<<endl;
- cout << "#2 '- ";
- cin >> two;
- cout <<""<<endl<<endl;
- cout << "Uzupełnij dane"<<endl;
- cout << "Uzupełniaj tylko za pomocą liczb dziesiętnych"<<endl<<endl;
- cout << "Równanie #1"<<endl;
- cout << "ax = ";
- cin >> a1; cout <<""<<endl;
- cout << "by = ";
- cin >> b1; cout <<""<<endl;
- cout << "c = ";
- cin >> c1; cout<<""<<endl;
- cout << "Równanie #2"<<endl;
- cout << "ax = ";
- cin >> a2; cout <<""<<endl;
- cout << "by = ";
- cin >> b2; cout <<""<<endl;
- cout << "c = ";
- cin >> c2; cout<<""<<endl<<endl;
- W = (a1*b2)-(a2*b1);
- X = (c1*b2)-(c2*b1);
- Y = (a1*c2)-(a2*c1);
- m = X/W;
- n = Y/W;
- if (W != 0)
- {
- cout << "==============================="<<endl<<endl;
- cout << "Istnieje rozwiązanie"<<endl;
- cout << "x = "; cout << m<<endl;
- cout << "y = "; cout << n<<endl<<endl;
- cout << "==============================="<<endl<<endl<<endl<<endl;
- cin.get();
- }
- if (W == 0 && X != 0 || Y != 0)
- {
- cout << "==============================="<<endl<<endl;
- cout << "Zbiór nie ma rozwiązania"<<endl;
- cout << "Zbiór jest sprzeczny"<<endl<<endl;
- cout << "==============================="<<endl<<endl<<endl<<endl;
- cin.get();
- }
- if (W == 0 && X == 0 && Y == 0)
- {
- cout << "==============================="<<endl<<endl;
- cout << "Zbiór ma nieskończenie wiele rozwiązań"<<endl<<endl;
- cout << "==============================="<<endl<<endl<<endl<<endl;
- cin.get();
- }
- cout << "Autor Tomek Prabucki";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement