In: Computer Science
import java.io.*;
public class TheWord
{
public static void main(String[] args) throws
IOException
{
File f1= new
File("input.txt");
BufferedReader br = new
BufferedReader(new FileReader(f1));
int count=0,present;
String[] words=null;
String s;
String search="the";
while
((s=br.readLine())!=null)
{
words=s.split("
");
present=0;
for (String
word:words)
{
if (word.equalsIgnoreCase(search))
{
count++;
present=1;
}
if (present==1)
break;
}
}
System.out.println("the :
"+count);
}
}