当前位置: 代码迷 >> 综合 >> As a New Year‘s gift
  详细解决方案

As a New Year‘s gift

热度:79   发布时间:2023-11-27 04:04:17.0

在这里插入图片描述
去掉逗号就行。

import java.util.Scanner;public class Main {
    public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);while(sc.hasNext()) {
    String s = sc.next();char[] str = s.toCharArray();for (int i = 0; i < 19; i++) {
    if(i == 5 || i ==13){
    str[i] = ' ';}}for (int i = 0; i < 19; i++) {
    System.out.print(str[i]);}System.out.println();}}
}
  相关解决方案