commit 3ee72952d18cc4fbc029214e59e92590d879db76 Author: Tilo Brockmann Date: Tue Oct 24 15:43:18 2023 +0200 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f68d109 --- /dev/null +++ b/.gitignore @@ -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 \ No newline at end of file diff --git a/Prog3A.iml b/Prog3A.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Prog3A.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/prak1/Main.java b/src/prak1/Main.java new file mode 100644 index 0000000..e7170ee --- /dev/null +++ b/src/prak1/Main.java @@ -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; + } + } + +} \ No newline at end of file