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 r = cin.next();
String s2 = "";
for (int i = 0; i < s.length(); i ++)
{
if (s.charAt(i) == r.charAt(0))
s2 += "#";
else
s2 += s.charAt(i);
}
System.out.println (s2);
}
}