1.7编程基础之字符串03:基因相关性

#include<iostream>
#include<cstring>
#include<cstdio>
#include<cstdlib>
using namespace std;
double num;
char a[1000001];
char b[1000001];
char c[1];
int main()
{
    double tot=0;
    scanf("%lf",&num);
    gets(c);
    gets(a);
    gets(b);
    int l=strlen(a);
    for(int i=0;i<=l;i++)
    {
        if(a[i]==b[i])tot++;
    }
    if((double)tot/l>num)
    {
        cout<<"yes";        
    }
    else 
    cout<<"no";
    return 0;
}

 

posted @ 2017-02-27 15:26  自为风月马前卒  阅读(889)  评论(0编辑  收藏  举报

Contact with me