1.题目: Given an input string, reverse the string word by word. For example,Given s = "the sky is blue",return "blue is sky the". 运用到了栈的思想.先进后出,这样就逆序了. 时间复杂度,就是整个程序在运行过程中,每个小模块运行的次数之和. 时间复杂度指运行时间需求,空间复杂度是指运行空间需求. public class toChar1{ pu…
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner in = new Scanner(System.in); String s = in.nextLine(); CodeLength(s); } public static void CodeLength(String s){ String [] str = s.split(" "); int lengt…