题解 | #字符串分隔#

字符串分隔

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

暴力就完事了
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
 public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        String str=sc.nextLine();
        String b="";
        ArrayList list=new ArrayList();
            while (str.length()>8){
                b=str.substring(0, 8);
                list.add(b);
                str =str.replaceAll(b,"");
            }
            while (str.length()<8){
                str=str+"0";
            }
            list.add(str);
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
        }       
}
全部评论

相关推荐

smile丶snow:空间可以优化下,基本都是一张a4纸的pdf。第二个项目感觉缺一个背景。就是你为什么要写这个东西。因为网站xx性能问题所以写了这个可以编一个。可以只要自我评价的内容,专业技能的感觉可以删掉。然后技能证书也可以去掉。在自我评价加一个英语能力就行了。个人建议哈
简历被挂麻了,求建议
点赞 评论 收藏
分享
03-17 15:22
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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