Advertisement
Guest User

Evil I <3 you

a guest
Oct 24th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. #include <stdlib.h>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. float a = 0;
  10. float b = 0;
  11. float c = 0;
  12. int n = 2;
  13. float k1 = 0;
  14. float k2 = 0;
  15. cout << "Te ayudare a resolver tu ecuación de segundo grado: " << endl;
  16. cout << "ingrese el valor de a " << endl;
  17. cin >> (a);
  18. cout << "ingrese el valor de b " << endl;
  19. cin >> (b);
  20. cout << "ingrese el valor de c " << endl;
  21. cin >> (c);
  22. k1 = (-b + (sqrt(pow(b, n) - (4 * a * c)))) / (2 * a);
  23. k2 = (-b - (sqrt(pow(b, n) - (4 * a * c)))) / (2 * a);
  24. cout << "x1 es igual a: " << k1 << endl;
  25. cout << "x2 es igual a: " << k2 << endl;
  26. cout << "FUCK YEAH!!" << endl;
  27. system("pause>null");
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement