为了账号安全,请及时绑定邮箱和手机立即绑定

大神求教java

大神求教java

540Immortal 2018-05-21 15:58:45
7-1 字符串替换(10 分)将文本文件中指定的字符串替换成新字符串。 由于目前的OJ系统暂时不能支持用户读入文件,我们编写程序从键盘输入文件中的内容,当输入的一行为end时,表示结束。end后面有两个字符串,要求用第二个字符串替换文本中所有的第一个字符串。输入格式:Xi’an Institute of Posts and Telecommunications is co-designed and implemented by the People’s Government of Shaanxi Province and the Ministry of Industry and Information Technology. The Institute is located in Xi’an, a historic city in Northwest China, famous for its magnificent ancient culture.end (表示结束)Institute (第一个字符串,要求用第二个字符串替换)University (第二个字符串)输出格式:Xi’an University of Posts and Telecommunications is co-designed and implemented by the People’s Government of Shaanxi Province and the Ministry of Industry and Information Technology.The University is located in Xi’an, a historic city in Northwest China, famous for its magnificent ancient culture.
查看完整描述

2 回答

?
酒木君

TA贡献23条经验 获得超7个赞

我是以空格进行字符串分隔的,这种方法可能不是很严谨,时间有限,你可以在我的基础上再添加其他限制条件完善功能

查看完整回答
1 反对 回复 2018-05-22
  • 2 回答
  • 0 关注
  • 2109 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信