如果喜歡的話就拿去吧,不用客氣。>Ω<
package com.software.fanfan.ai;
import java.util.Scanner;
/**
* Created by 追夢(mèng)1819 on 2019-01-25.
*/
public class AI {
? ? public static void main(String[] args) {
? ? ? ? Scanner scanner = new Scanner(System.in);
? ? ? ? String question;
? ? ? ? while (true){
? ? ? ? ? ? question = scanner.next();
? ? ? ? ? ? question = question.replace("嗎","");
? ? ? ? ? ? question = question.replace("我","我也");
? ? ? ? ? ? question = question.replace("?","!");
? ? ? ? ? ? System.out.println(question);
? ? ? ? }
? ? }
}
看看運(yùn)行結(jié)果啊:
有了這段代碼,從此,當(dāng)上CEO,變成高富帥,迎娶白富美,走上人生巔峰,不再是夢(mèng)想!哈哈@#¥!%¥#@!
如果你對(duì)編程感興趣或者想往編程方向發(fā)展,可以關(guān)注微信公眾號(hào)【筑夢(mèng)編程】,大家一起交流討論!小編也會(huì)每天定時(shí)更新既有趣又有用的編程知識(shí)!