解析:求PAT总数,要先将问题拆分先求有效PA总数 从左遍历字符串,遇到P就累计P数量,A前面有效的P的数量就是pacount+=pcount;T同理 public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String text = in.nextLine(); int pcount = 0; int pacount= 0; int totalcount = 0...