This commit is contained in:
moritz
2024-10-15 15:28:19 +02:00
commit 749579a6f8
7 changed files with 97 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
public static void main(String[] args) {
//TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
// to see how IntelliJ IDEA suggests fixing it.
System.out.printf("Hello and welcome!");
for (int i = 1; i <= 5; i++) {
//TIP Press <shortcut actionId="Debug"/> to start debugging your code. We have set one <icon src="AllIcons.Debugger.Db_set_breakpoint"/> breakpoint
// for you, but you can always add more by pressing <shortcut actionId="ToggleLineBreakpoint"/>.
System.out.println("i = " + i);
}
}
}
+5
View File
@@ -0,0 +1,5 @@
public class helloWorld {
public static void main (String[] args){
System.out.println("Hello World!");
}
}
+26
View File
@@ -0,0 +1,26 @@
package praktikum01;
public class Zahlenfelder {
public static void main(String[] args) {
for (int i = 1; i < 201; i++) {
// Wenn durch 5 Teilbar
if (i % 5 == 0) {
System.out.println(i + " - <Zahl> ist durch 5 Teilbar");
}
wennEndeGleichNeun(i);
}
}
public static void wennEndeGleichNeun(int i){
// Wenn Zahl auf 9 endet
if (i % 10 == 9) {
System.out.println(i + " - <Zahl> endet auf 9");
}
}
}