Facebook
From Agata, 5 Years ago, written in Plain Text.
This paste is a reply to agatka from domcia - view diff
Embed
Download Paste or View Raw
Hits: 470
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4. int main ()
  5. {
  6.         float a, b, c, x1, x2, delta;
  7.         cout <<"Podaj wartosc a: ";
  8.         cin >> a;
  9.         cout << "Podaj wartosc b: ";
  10.         cin >> b;
  11.         cout << "Podaj wartosc c: ";
  12.         cin >> c;
  13.         if (a==0)
  14. {
  15.         cout << "Nie dziala";
  16. }
  17. delta = b*b-(4*a*c);
  18. if (delta==0)
  19. {
  20.         x1= (-b)/(2*a);
  21.         cout <<"Wynik to: "<< x1;
  22. }
  23. else
  24. {
  25. if(delta>0)
  26. {
  27. delta=sqrt(delta);
  28. x1=(-b-delta)/(2*a);
  29. cout << "x1 to: "<< x1 <<endl;
  30. x2=(-b+delta)/(2*a);
  31. cout << "x2 to: "<< x2;
  32. }
  33. else
  34. {
  35.         cout <<"delta ujemna";
  36. }
  37. }
  38.         return 0;
  39. }

Replies to i tak nic ci to nie da rss

Title Name Language When
Re: i tak nic ci to nie da vol.2 Agata text 5 Years ago.