prog3
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
public class helloWorld {
|
||||
public static void main (String[] args){
|
||||
System.out.println("Hello World!");
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user