Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main() {
- int a,b,c;
- int delta=b*b-4*a*c;
- int x1,x2;
- cout <<"podaj wspolczynniki liczbowe" <<endl;
- cout <<"a:";
- cin >> a;
- cout << endl;
- cout <<"b:";
- cin >> b;
- cout << endl;
- cout <<"c:";
- cin >> c;
- cout << endl;
- cout <<"twoja delta wynosi " << delta <<endl;
- cout <<" a pierwiastek z delty wynosi " << sqrt(delta)<<endl;
- if (delta>0){
- x1=-b-sqrt(delta)/2*a;
- x2=-b+sqrt(delta)/2*a;
- cout << "pierwsze miejsce zerowe wynosi " << x1 << endl;
- cout << "drugie miejsce zerowe wynosi " << x2 << endl;
- }
- else if(delta=0){
- x1=-b/2*a;
- cout << "miejsce zerowe wynosi " << x1 << endl;
- }
- else if(delta<0){
- cout << "funkcja nie posiada miejsce zerowych" << endl;
- }
- else if (a=0){
- x1 = -c / b;
- cout <<"funkcja liniowa wynosi " << x1 <<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement