From 16dfe7379b0e91f595b5a1ed59558109fa1adfac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=9B=E9=AA=8F=E6=B4=8B?= <836157478@qq.com> Date: Sat, 5 Aug 2023 08:52:21 +0000 Subject: [PATCH] =?UTF-8?q?update=20problems/0014.=E5=8F=A5=E5=AD=90?= =?UTF-8?q?=E7=BC=A9=E5=86=99.md.=20=E6=B7=BB=E5=8A=A0=E4=BA=86java?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=80=9D=E8=B7=AF2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 盛骏洋 <836157478@qq.com> --- ...45\345\255\220\347\274\251\345\206\231.md" | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git "a/problems/0014.\345\217\245\345\255\220\347\274\251\345\206\231.md" "b/problems/0014.\345\217\245\345\255\220\347\274\251\345\206\231.md" index ead4154..a915642 100644 --- "a/problems/0014.\345\217\245\345\255\220\347\274\251\345\206\231.md" +++ "b/problems/0014.\345\217\245\345\255\220\347\274\251\345\206\231.md" @@ -69,6 +69,38 @@ public class Main{ } } ``` +### Java思路2 +```java +import java.util.Scanner; + +public class Main{ + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int n=in.nextInt(); + in.nextLine(); + for (int j = 0; j < n; j++) { + String s=in.nextLine(); + StringBuilder sb=new StringBuilder(); + boolean flag=true; + for (int i=0;i