daily pastebin goal
40%
SHARE
TWEET

Untitled

a guest May 16th, 2018 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <math.h>
  3. #include <stdio.h>
  4. using namespace std;
  5. int main()
  6. {
  7.     int a,b,c,delta;
  8.     cout << "Podaj a: ";
  9.     cin >> a;
  10.     cout << "\nPodaj b: ";
  11.     cin >> b;
  12.     cout << "\nPodaj c: ";
  13.     cin >> c;
  14.     delta = b*b-4*a*c;
  15.     cout << "\nDelta = " << delta << endl;
  16.     float pierw = sqrt(delta);
  17.     if(delta > 0)
  18.     {
  19.              cout << "x1 = " << ((-b-pierw)/(2*a)) << endl;
  20.              cout << "x2 = " << ((-b+pierw)/(2*a)) << endl;
  21.     }
  22.     else if(delta == 0)
  23.     {
  24.              cout << "x = " << (-b/(2*a)) << endl;
  25.     }
  26.     else
  27.     {
  28.         cout << "Brak miejsc zerowych" << endl;
  29.     }
  30.     system("pause");
  31.     return 0;
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top