HI!
Wisst ihr wie das Programm funktioniert?
Man soll einen String eingeben und es soll den String zum Beispiel so ausgeben:
Beispiel: String: Hallo
Hallo
alloH
lloHa
loHal
oHall
Hallo
mfg
Druckbare Version
HI!
Wisst ihr wie das Programm funktioniert?
Man soll einen String eingeben und es soll den String zum Beispiel so ausgeben:
Beispiel: String: Hallo
Hallo
alloH
lloHa
loHal
oHall
Hallo
mfg
Code:import java.io.*;
public class Lauftext
{
public static void main(String args[])
throws IOException
{
String lauftext = "";
BufferedReader puffer = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Text eingeben: ");
lauftext = puffer.readLine();
System.out.println(lauftext);
for(short i = 0 ; i < lauftext.length() ; i++)
{
lauftext = lauftext.substring(1) + lauftext.charAt(0);
System.out.println(lauftext);
}
}
}