This commit is contained in:
uns2en69
2026-02-18 02:54:17 +03:00
commit b6f78044a0
49 changed files with 660 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int a,b;
double x = 0;
System.out.print("Введите a= ");
a = in.nextInt();
System.out.print("Введите b= ");
b = in.nextInt();
if (a > b){
x = (double)(a*b - 5) / a;
} else if (a < b){
if (b != 0) {
x = (double)a / b + 1;
} else {
System.out.println("Ошибка: деление на ноль!");
}
} else {
x = -1;
}
System.out.printf("При a=%d b=%d x=%.2f%n", a, b, x);
}
}