50,856
社区成员
发帖
与我相关
我的任务
分享
public static void main(String[] args) {
Scanner text = new Scanner(System.in);
StringBuilder strBuilder = new StringBuilder();
String text2 = text.next();
for (int i = 0; i < text2.length(); i++) {
char charAt = text2.charAt(i);
if (charAt != '$') //结束符$
strBuilder.append(charAt);
else if (charAt == '$') {
System.out.println(strBuilder.toString());
//StringBuilder strBuilder = new StringBuilder();
}
//continue;
}
}