import java.util.Formatter;
public class ASCII2
{
public static void main(String[] args)
{
System.out.println("*** ASCII-Tabelle ***");
System.out.println();
System.out.println("Okt Dez Hex Zch Okt Dez Hex Zch Okt Dez Hex Zch Okt Dez Hex Zch ");
System.out.println("------------------------------------------------------------------ ");
int zahl = 0;
for (int i = 0; i < 32; i++)
{
System.out.print(formatieren(zahl) + " ");
System.out.print(formatieren(zahl + 32) + " ");
System.out.print(formatieren(zahl + 64) + " ");
System.out.println(formatieren(zahl + 96));
zahl++;
}
}
public static String formatieren(int zahl)
{
Formatter formatter = new Formatter();
if (zahl < 32 || zahl > 126)
{
return formatter.format("%1$03o %1$03d %1$03x ...", zahl).toString();
} else
{
return formatter.format("%1$03o %1$03d %1$03x %1$c ", zahl).toString();
}
}
}
Das ging auch relativ schnell.
Und was kommt jetzt?
SUDOKU lösen
Oh no

