Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock raizdelta(a,b,c)
- {
- new delta;
- delta = (b < 0 ? ((-b << 1)-4*a*c) : ((b << 1)-4*a*c));
- printf("%dx² %dx %d\n ? = %d² -4 x %d x %d\n ? = %d\n x = %d +- Raiz de %d(? = Delta) / 2 x %d", a, b, c, b, a, c, delta, b < 0 ? b*-1 : b, delta, a);
- if(delta < 0)
- printf("Não existe raiz de delta negativo!");
- else
- for(new x = 0; x ^ delta; ++x)
- if(x*x == delta)
- printf(" x' = %d+%d / 2 x %d = %d", b, x, a, (-b+x)/(2*a)),
- printf(" x'' = %d-%d / 2 x %d = %d", b, x, a, (-b-x)/(2*a)),
- printf(" S = {%d,%d}", (-b+x)/(2*a), (-b-x)/(2*a));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement