Java 代码
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
String s = cin.nextLine();
String a = cin.next();
String b = cin.next();
System.out.println(s.replaceAll("\\b"+a+"\\b", b));
}
}