Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main() {
- int a,b,c;
- cin >> a >> b >> c;
- int d;
- d= b*b - 4 * a * c;
- if(d > 0){
- cout << "x1 = "<< -b -sqrt(d) / 2*a;
- cout << "x2 = " << -b + sqrt(d) / 2 * a;
- }else if(d == 0){
- cout << "x0 ="<< -b / 2*a;
- } else{
- cout << "brak miejsc zerowych";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement