我错哪了

请大神指点迷津。。。

#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
int n,i,count=0,k,l;
char a[502];
char b[502];
scanf ("%d",&n);
gets(a);
gets(b);
l=strlen (a);
for (i=0;i<l;i++)
{
if (a[i]==b[i])
{
count++;
}
}
k=count/l;
if (k<n)
{
printf("yes");
}
else printf("no");
return 0;
}

为什么只能读入一行?

posted @ 2019-12-01 23:13  小浩浩在此  阅读(77)  评论(0)    收藏  举报