Code:
import java.io.*;
import java.util.*;
public class Raetsel
{
public static void main(String argv[]) throws Exception
{
String str;
int[] b = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
int i=1;
String[] c = {" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "};
String[] a = {" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "};
BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
String[] alphabet = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"};
System.out.print("Texteingabe: ");
str = input.readLine();
str = "--20--8--5--26--19--3--5--14--5--";
java.util.Arrays.toString(a=str.split("--"));
while (a[i]!=" ")
{
if (a[i]!="--")
{
b[i]=Integer.parseInt(a[i])-1;
c[i]= alphabet[b[i]];
System.out.println(c[i]);
}
else
{
break;
}
i++;
}
System.out.println();
System.out.println("Programmende Raetsel");
}
}
was soll das programm machen: