Java 代码
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
double r = cin.nextDouble();
String a = cin.next();
String b = cin.next();
int count = 0;
for (int i = 0; i < a.length(); i ++)
{
if (a.charAt(i) == b.charAt(i))
count += 1;
}
if (count * 1.0/ a.length() >= r)
System.out.println ("yes");
else
System.out.println ("no");
}
}