Initial
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
public class HelloWorld {
|
||||
public static void main (String[] args) {
|
||||
System.out.println("Hello World");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// Press Shift twice to open the Search Everywhere dialog and type `show whitespaces`,
|
||||
// then press Enter. You can now see whitespace characters in your code.
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
// Press Alt+Enter with your caret at the highlighted text to see how
|
||||
// IntelliJ IDEA suggests fixing it.
|
||||
System.out.printf("Hello and welcome!");
|
||||
|
||||
// Press Shift+F10 or click the green arrow button in the gutter to run the code.
|
||||
for (int i = 1; i <= 5; i++) {
|
||||
|
||||
// Press Shift+F9 to start debugging your code. We have set one breakpoint
|
||||
// for you, but you can always add more by pressing Ctrl+F8.
|
||||
System.out.println("i = " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package praktikum01;
|
||||
|
||||
public class ZahlenFilter {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
ZahlenFilter main = new ZahlenFilter();
|
||||
main.Filterfuer5();
|
||||
main.Filterfuer9();
|
||||
main.Filterfuer3();
|
||||
|
||||
}
|
||||
|
||||
private void Filterfuer5() {
|
||||
for (int i = 1; i <= 200; i++) {
|
||||
if (i % 5 == 0) {
|
||||
System.out.println(i + " ist durch 5 teilbar!");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void Filterfuer9() {
|
||||
for (int i = 1; i <= 200; i++) {
|
||||
if (i % 10 == 9) {
|
||||
System.out.println(i + "endet auf 9!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Filterfuer3() {
|
||||
|
||||
for (int i = 1; i <= 200; i++) {
|
||||
if (((i + (i - 1)) % 3 == 0)) {
|
||||
int ergebnis = i + (i - 1);
|
||||
System.out.println(i + " und " + (i - 1) + " addiert ergeben " + ergebnis + " und " + ergebnis + " ist durch 3 teilbar!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user