Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- System.out.println("Квадратное уравнение: x^2+7x+10=0");
- int d;
- int b=7;
- int a=1;
- int c=10;
- double x1;
- double x2;
- d = b*b - 4 * a * c;
- x1 = (-b + Math.sqrt(d))/2;
- x2 = (-b - Math.sqrt(d))/2;
- System.out.println("Его корни: "+x1+" "+x2);
- }
- }
Add Comment
Please, Sign In to add comment