44 lines
754 B
Java
44 lines
754 B
Java
|
|
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 aufgabe2()
|
|
{
|
|
for (int i = 1; i < 21; i++)
|
|
{
|
|
System.out.println(i * i);
|
|
}
|
|
}
|
|
|
|
|
|
public static void aufgabe3()
|
|
{
|
|
int i = 1;
|
|
int x = 1;
|
|
while ( i < 484)
|
|
{
|
|
i++;
|
|
x++;
|
|
i = x * x;
|
|
System.out.println(i);
|
|
}
|
|
}
|
|
|
|
|
|
public static void aufgabe5()
|
|
{
|
|
int zufallszahl = (int) (Math.random()* 10 + 1);
|
|
}
|
|
}
|
|
|