56 lines
1020 B
Java
56 lines
1020 B
Java
import java.util.Scanner;
|
|
|
|
public class Schleifen
|
|
{
|
|
public static void aufgabe1()
|
|
{
|
|
for(int i = 0; i < 30; i++)
|
|
{
|
|
System.out.println("Nur Übung macht den Meister");
|
|
|
|
}
|
|
}
|
|
|
|
public static void aufgabe3a()
|
|
{
|
|
for (int i = 1; i < 21; i++)
|
|
{
|
|
System.out.println(Methoden.quadrat(i));
|
|
}
|
|
|
|
|
|
}
|
|
|
|
public static void aufgabe3b()
|
|
{
|
|
int i = 1;
|
|
int x = 1;
|
|
while (i * i < 500)
|
|
{
|
|
x = i * i;
|
|
System.out.println(x);
|
|
i++;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
public static void aufgabe4Endlosschleife()
|
|
{
|
|
while (true)
|
|
{
|
|
System.out.println("AAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHH!! HILFEE!!");
|
|
|
|
}
|
|
}
|
|
|
|
public static void aufgabe5()
|
|
{
|
|
int ranNum = (int) (Math.random() *10 + 1);
|
|
Scanner sc = new Scanner(System.in);
|
|
|
|
}
|
|
}
|
|
|
|
|