Advertisement
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 ";
- cin >> a ;
- cout << "podaj liczbe b " ;
- cin >> b;
- cout << "podaj liczbe c " ;
- cin >> c;
- cout << "\na=" <<a<< "; b="<<b<<"; c="<<c <<".\n";
- if (a==0){
- cout << "\nFunkcja liniowa\n";
- }
- else {
- cout << "\nFunkcja kwadratowa, bo a>0\n";
- int d=b*b-4*a*c;
- cout << "\nDelta wynosi " <<d <<"\n";
- if (d>0) {
- cout << "Funkcja posiada 2 miejsca zerowe";
- int j=(-b-sqrt(d))/(2*a);
- cout << "\nx1 = " << j;
- int k=(-b+sqrt(d)/(2*a));
- cout << "\nx2 = " << k;
- }
- if (d=0){
- cout << "Delta wynosi " << -b/(2*a);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement