编程题:32
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String line = scanner.nextLine();
String[] words = line.trim().split("\s+");
StringBuilder result = new StringBuilder();
for (int i = words.length - 1; i >= 0; i--) {
result.append(words[i]);
if (i > 0) {
result.append(" ");
}
}
System.out.println(result);
}
}

posted on 2025-05-21 22:37  Swishy  阅读(4)  评论(0)    收藏  举报