Advertisement
Guest User

marusiaaaa

a guest
Dec 7th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5. int a,b,c;
  6.  
  7. int main()
  8. {
  9. cout << "podaj liczbe a ";
  10. cin >> a ;
  11. cout << "podaj liczbe b " ;
  12. cin >> b;
  13. cout << "podaj liczbe c " ;
  14. cin >> c;
  15.  
  16. cout << "\na=" <<a<< "; b="<<b<<"; c="<<c <<".\n";
  17.  
  18. if (a==0){
  19. cout << "\nFunkcja liniowa\n";
  20. }
  21. else {
  22. cout << "\nFunkcja kwadratowa, bo a>0\n";
  23.  
  24. int d=b*b-4*a*c;
  25. cout << "\nDelta wynosi " <<d <<"\n";
  26. if (d>0) {
  27. cout << "Funkcja posiada 2 miejsca zerowe";
  28. int j=(-b-sqrt(d))/(2*a);
  29. cout << "\nx1 = " << j;
  30. int k=(-b+sqrt(d)/(2*a));
  31. cout << "\nx2 = " << k;
  32. }
  33.  
  34. if (d=0){
  35. cout << "Delta wynosi " << -b/(2*a);
  36. }
  37. }
  38.  
  39.  
  40.  
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement