top1编程
← 返回题目
题解

基因相关性

1 条题解

  • 0
    @ 2026-7-28 22:45:20
    #include<bits/stdc++.h>
    using namespace std;
    //基因相关性
    int main()
    {
    	char a[510];
    	char b[510];
    	double c;
    	int s=0;
    	cin>>c;
        cin>>a;
    	cin>>b;
    	for(int i=0;i<strlen(a);i++){
    		if(a[i]==b[i]){
    			s++;
    		}
    	}
    	int n=strlen(a);
    	if(s*1.0/n>=c){
    		cout<<"yes";
    	}
    	else{
    		cout<<"no";
    	}
    	return 0;
    }
    
    • 1