题解 | 字符串分隔

字符串分隔

https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        int len = s.length();
        int i = 0;
        while(i < len){
            System.out.print(s.charAt(i));
            i++;
            if(i > 7  && i % 8 == 0){
                System.out.println();
            }
        }
        while(i % 8 != 0){
            System.out.print(0);
            i++;
        }

    }
}

全部评论

相关推荐

1jian10:48h没写面评会变成这样
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务