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

11
lab1/lab1.iml Normal file
View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

Binary file not shown.

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);
}
}

BIN
lab1/ООП lab1.pdf Normal file

Binary file not shown.