参考代码:
import java.util.Scanner; public class Main { public static void main(String []args) { Scanner scan=new Scanner(System.in); double yu=scan.nextDouble(); scan.nextLine(); String s1=scan.nextLine(); String s2=scan.nextLine(); double cnt=0; for(int i=0;i<s1.length();i++) { if(s1.charAt(i)==s2.charAt(i)) { cnt++; } } if(cnt/s1.length()>=yu) { System.out.println("yes"); } else { System.out.println("no"); } } }
0.0分
0 人评分