Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <math.h>
- using namespace std;
- int main()
- {
- int a;
- int b;
- int c;
- cout << "Especifique a \n";
- cin >> a;
- cout << "Especifique b \n";
- cin >> b;
- cout << "Especifique c \n";
- cin >> c;
- int bSUM = b * b;
- int acMULT = -4 * a * c;
- int abcSUM = bSUM + acMULT;
- cout << "Discriminante: " << abcSUM << endl;
- //Resultado 1
- int RaizR;
- int Twoa;
- int NoB;
- int resUMsum;
- int resUMdiv;
- RaizR = sqrt(abcSUM);
- Twoa = 2 * a;
- NoB = -1 * b;
- resUMsum = NoB + RaizR;
- resUMdiv = resUMsum / Twoa;
- cout << "Resultado 1: " << resUMdiv << endl;
- //Resultado 2
- int RaizRd;
- int Twoad;
- int NoBd;
- int resUMsumd;
- int resUMdivd;
- RaizRd = sqrt(abcSUM);
- Twoad = 2 * a;
- NoBd = -1 * b;
- resUMsumd = NoBd + RaizRd;
- resUMdivd = resUMsumd / Twoad;
- cout << "Resultado 2: " << resUMdivd << endl;
- cout << "Créditos Renato Lopes (steam: id/RenatoBeSt) Dev-hg.net e infoescola.com";
- // Managed to accomplish this on 5 tutorials!
- // Consegui isso em 5 tutoriais!
- // thx http://www.dev-hq.net/c++/3--mathematical-operators &
- // http://www.infoescola.com/matematica/formula-de-bhaskara/
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement