• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# Untitled

a guest Aug 21st, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. import math
2.
3. print('-' * 30, ' Coeficientes ', '-' * 30)
4. valorA = int(input('Insira o coeficiente de A: '))
5. valorB = int(input('Insira o coeficiente de B: '))
6. valorC = int(input('Insira o coeficiente de C: '))
7.
8. print('-' * 30, ' Raízes ', '-' * 30)
9. delta = math.pow(valorB, 2) - (4 * valorA * valorC)
10. x1 = (-valorB + math.sqrt(delta)) / 2 * valorA
11. x2 = (-valorB - math.sqrt(delta)) / 2 * valorA
12. print('Raízes: {:.0f} e {:.0f}'.format(x1, x2))
13.
14. print('-' * 30, ' Coordenada das vértices ', '-' * 30)
15. Xv = -valorB / (2 * valorA)
16. Yv = valorA * math.pow(Xv, 2) + valorB * Xv + valorC
17. print('V({:.0f}; {:.0f})'.format(Xv, Yv))
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.

Top