https://pintia.cn/problem-sets/994805046380707840/problems/1111914599412858880
解析
这道题很简单,貌似也没有出现句子长度小于大笨钟的情况,例如这种:
xun zhang zhai ju lao diao chong, yu gong.
AC Code
public static void main(String[] args) throws Exception {
int n = nextInt();
String end = "qiao ben zhong.";
while(n-- != 0) {
String[] A = br.readLine().trim().split(",");
if(!A[0].endsWith("ong") || !A[1].endsWith("ong.")) {
out.println("Skipped");
continue;
}
String text = A[0] + ",";
String[] B = A[1].split(" ");
for(int i = 0; i < B.length - 3; i++) {
text += B[i] + " ";
}
text += end;
out.println(text);
}
out.flush();
}