| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 84203 | bnu_fanmeijie | 基因相关性 | C++ | 通过 | 0 MS | 248 KB | 440 | 2026-02-09 12:00:35 |
#include<bits/stdc++.h> using namespace std; int main() { double s,ans=0.0; //ans求比例 int t=0,n; //t为计数器,n求项数 char a[500],b[500]; cin>>s; scanf("%s %s",a,b); //输入字符串 for(int i=0;a[i]!='\0';i++) //for循环枚举 { if(a[i]==b[i]) ///如果相等 t++; //计数器加一 n=i; } ans=t*1.0/n; //求出比例 if(ans>=s) //判断 cout<<"yes"; else cout<<"no"; return 0; }