帮帮忙呀

[复制链接]
查看11 | 回复1 | 2007-8-6 15:19:02 | 显示全部楼层 |阅读模式
import jave.io.*;
public class Search
{
public static void main (String args[])
{
int first=0,second=0,count=0;
String text="Sorry I have to miss your get-together I have to go to Freds to meet the in-laws What a drag Next time Thank you for the kind invitation Unfortunately
I have a prior engagement that evening hope we have another opportunity to meet The first apology was written to my friend My grammar is more casual and I use slang
In the sentence written to my boss I am more careful with my vocabulary and grammar";
String s ="";
String subText=text;
String.out.println(text);
String.out.println("请输要统计的单 : &quot

;
try
{

BufferedReader in=new BufferedReader (

new InputStreamReader(System.in));

s=in.readLine();

}catch (IOException e){}

for(int i=1;i<=text.length();i+=second+1)

{

second=subText.indexOf(" &quot

;

String temp=subText.substring(first,second);

if(s.equalsIgnoreCase(temp))count++;

subText=subText.substring(second+1);

}

if(count==0)

System.out.println("单"+s+"没出现呀&quot

;

else

System.out.println("单"+s+"出现"+count+"次&quot

;

}
}
回复

使用道具 举报

千问 | 2007-8-6 15:19:02 | 显示全部楼层
说清楚你他妈的要干啥
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行