import java.util.Scanner;
public class TestTest {
public static void main(String [] a){
Scanner in=new Scanner(System.in);
while(true){
String s=in.nextLine();
if(s.equalsIgnoreCase("quit")){
System.exit(0);
}
String[] ss=s.split("\\s+");
StringBuffer sb=new StringBuffer();
for (int i=ss.length-1;i>=0;i--){
sb.append(ss[i]+" ");
}
System.out.println(sb);
}
}
}
时间: 2024-10-14 09:25:28