56 lines
1.2 KiB
Java
Executable File
56 lines
1.2 KiB
Java
Executable File
|
|
/**
|
|
* Beschreiben Sie hier die Klasse Doppelschleife.
|
|
*
|
|
* @author (Ihr Name)
|
|
* @version (eine Versionsnummer oder ein Datum)
|
|
*/
|
|
public class Doppelschleife
|
|
{
|
|
public static void uhr()
|
|
{
|
|
for (int stunden = 0; stunden <24; stunden ++)
|
|
{
|
|
for (int minuten = 0; minuten <60; minuten ++)
|
|
{
|
|
for (int sekunden = 0;sekunden < 60; sekunden ++)
|
|
{
|
|
System.out.println(stunden + ":" + minuten + ":" + sekunden);
|
|
try
|
|
{
|
|
Thread.sleep(1000);
|
|
}
|
|
catch(InterruptedException ex)
|
|
{
|
|
ex.printStackTrace();
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public static void einmaleins()
|
|
{
|
|
for (int a=1 ; a<=10 ; a++)
|
|
{
|
|
for (int b=1; b<=10 ; b++)
|
|
{
|
|
System.out.print (a*b + " ");
|
|
}
|
|
System.out.println (" ");
|
|
}
|
|
}
|
|
public static void muster()
|
|
{
|
|
for (int i=0; i<=5; i++)
|
|
{
|
|
for (int b=0; b<=i; b++)
|
|
{
|
|
|
|
System.out.print (i);
|
|
}
|
|
System.out.println (" ");
|
|
}
|
|
}
|
|
}
|