initial commit

This commit is contained in:
Tilo Brockmann 2023-10-24 15:43:18 +02:00
commit 3ee72952d1
3 changed files with 63 additions and 0 deletions

29
.gitignore vendored Normal file
View File

@ -0,0 +1,29 @@
### IntelliJ IDEA ###
out/
!**/src/main/**/out/
!**/src/test/**/out/
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

11
Prog3A.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>

23
src/prak1/Main.java Normal file
View File

@ -0,0 +1,23 @@
package prak1;
public class Main {
public static void main(String[] args) {
int previousValue = 0;
for (int i = 0; i < 200; i++) {
if (i == 0) {
continue;
} else if (i % 5 == 0) {
System.out.println(i + " ist durch 5 teilbar!");
} else if (Integer.toString(i).endsWith("9")) {
System.out.println(i + " endet auf 9!");
} else if ((i + previousValue) % 3 == 0) {
int res = i + previousValue;
System.out.println(i + " und " + previousValue + " addiert ergeben " + res + " und " + res + " ist durch 3 teilbar.");
}
previousValue = i;
}
}
}