今晚宜信的题,哪里出问题了?
发布于 2017-10-26 21:22 2141 次浏览 0 赞 来自 笔试面试  

大佬来看看,哪里出问题了?



import java.util.Scanner;


public class Main {


public static void main(String[] args) {

int i = 0;

boolean b = false;

Scanner sc = new Scanner(System.in);

int n = sc.nextInt();

int m = sc.nextInt();

int k = sc.nextInt();

int t = 0;

int j = 0;

int ww=0;

String[] s = new String[2 * m];

Scanner sc1 = new Scanner(System.in);

String ey = sc1.nextLine();

String[] a = ey.split(" ");

for(i=0;i<2*m;i++)

{

s[i]=sc1.nextLine();

}

if (n >= 1 && n <= 50 && m >= 1 && m <= 50 && k >= 1 && k <= 50) {

for (i = 1; i < 2 * m; i = i + 2) {

for (j = 0; j < n; j++) {


b = s[i].contains(a[j]);

if (b == true) {

b = false;

t = t + 1;

}

}

if(t>=k)

{

System.out.println(s[i-1]);

ww=1;

}

}


}

if(ww==0){

System.out.println();

}


}


}


1 条回复

题目中有一句是A若是非法网站,A的全部内容加入到敏感词中

我觉得问题就在于要把新识别出来的敏感词加进去,然后再识别一遍

直到敏感词没有变化了,这时检测出来的非法网站才是全的

2017-10-26 21:35
添加回复
回到顶部