Add files via upload

This commit is contained in:
dima0808
2023-02-22 20:28:48 +01:00
committed by GitHub
parent 9112df275b
commit 716b463e99
41 changed files with 538 additions and 0 deletions

20
lab1/src/Main.java Normal file
View File

@@ -0,0 +1,20 @@
public class Main {
public static void main(String[] args) {
float s = 0, a = 2, b = 1, m = 6, n = 4;
for (float i = a; i <= m; i++) {
for (float j = b; j <= n; j++) {
// Перевірка ділення на 0.
if (i == -1) {
System.out.println("Помилка: ділення на нуль не можливе.");
return;
}
s += (i + j) / (i + 1);
}
}
System.out.println("S = " + s);
}
}