Guest User

to wczesniejsze dzialalo

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