Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int a, b, c;
- int main()
- {
- cout << "Podaj liczbe a" << endl;
- cin >> a;
- cout << "Podaj liczbe b" << endl;
- cin >> b;
- cout << "Podaj liczbe c" << endl;
- cin >> c;
- cout << "a=" << a << ", b="<< b << ", c="<< c <<endl;
- if (a==0){
- cout << "funkcja liniowa" << endl;;
- }
- int d=b*b-4*a*c;
- if (a>0) {
- cout <<"funkcja kwadratowa" << endl;
- cout <<"Delta wynosi " << d << endl;
- }
- if (d>0){
- cout << " funkcja posiada 2 miejsca zerowe";
- cout << (-b-sqrt(d))/(2*a) << " oraz ";
- cout << (-b+sqrt(d))/(2*a) << endl;
- }
- if (d<0) {
- cout<< " funkcja nie posiada miejsc zerowych";
- }
- if (d=0) {
- cout <<" funkcja ma 1 miejsce zerowe";
- cout << -b/(2*a);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment