题解 | #牛牛的替换#

牛牛的替换

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

import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s1  = in.nextLine();
        String[] s2 = s1.split(" "); 
        String s = in.nextLine();
        String s3 = s.replace(s2[1],s2[2]);
        String s4 = s3.replace(s2[3],s2[4]);
        System.out.println(s4);

    }
}

全部评论

相关推荐

不愿透露姓名的神秘牛友
07-08 14:10
点赞 评论 收藏
分享
酷酷我灵儿帅:这去不去和线不线下面说实话没啥关系
点赞 评论 收藏
分享
05-26 09:07
已编辑
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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