Browse Source

initial commit

master
Tilo Brockmann 6 months ago
commit
3ee72952d1
3 changed files with 63 additions and 0 deletions
  1. 29
    0
      .gitignore
  2. 11
    0
      Prog3A.iml
  3. 23
    0
      src/prak1/Main.java

+ 29
- 0
.gitignore 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
- 0
Prog3A.iml 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
- 0
src/prak1/Main.java 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;
}
}

}

Loading…
Cancel
Save