Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class MyClass {
  3. public static void main(String args[]) {
  4. System.out.println("Dany jest uklad rownan postaci : ax^2 + bx + c = 0");
  5. int a = 2;
  6. int b = 5;
  7. int c = 10;
  8. System.out.println("Podane wartosci to : a=" + a + " , b=" + b + " , c=" + c);
  9.  
  10. double d=(b*b)-4*(a*c);
  11. double p=sqrt(d);
  12. double x=(-b-p)/2*a;
  13. double y=(-b+p)/2*a;
  14.  
  15. System.out.println("Delta wynosi :" + d + " , a miejsca zerowe to :" + x + " , oraz " + y);
  16.  
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement