import java.io.*;
public class Www
{
public static void main(String args[]) throws IOException
{ int i=0,j,k=0,m,count = 0;
char []a=new char[15];
FileReader f=new FileReader("bb.txt");
BufferedReader br=new BufferedReader(f);
int b[]=new int[100];
String str ,s;
str=br.readLine();
int k1=0;
int k2=0;
String[] str1=new String[100];
for(j=0;j<100;j++)
{
k1=str.indexOf("www.",k);
k2=str.indexOf("www.",k1+1);
if(k2==-1)
{
str1[j]=str.substring(k1);
System.out.println(str1[j]);
break;
}
str1[j]=str.substring(k1,k2-1);
System.out.println(str1[j]);
k+=str1[j].length();
count++;
}
for(j=0;j<=count;j++)
{
s=str1[j].substring(str1[j].indexOf(".") + 1, str1[j].indexOf(".", 4));
b[j]=s.length();
// System.out.println(b[j]);
}
BufferedReader read1=new BufferedReader(new InputStreamReader(System.in));
m=Integer.parseInt(read1.readLine());
String string="";
for(j=0;j<=count;j++){
if(m==b[j])
// System.out.println(str1[j]);
{
System.out.println(str1[j]);
string=string+" "+str1[j];
}
}
FileOutputStream fos=new FileOutputStream("bbb.txt");
OutputStreamWriter bj=new OutputStreamWriter(fos);
BufferedWriter fl=new BufferedWriter(bj);
fl.write(string);
fl.close();
}
}
public class Www
{
public static void main(String args[]) throws IOException
{ int i=0,j,k=0,m,count = 0;
char []a=new char[15];
FileReader f=new FileReader("bb.txt");
BufferedReader br=new BufferedReader(f);
int b[]=new int[100];
String str ,s;
str=br.readLine();
int k1=0;
int k2=0;
String[] str1=new String[100];
for(j=0;j<100;j++)
{
k1=str.indexOf("www.",k);
k2=str.indexOf("www.",k1+1);
if(k2==-1)
{
str1[j]=str.substring(k1);
System.out.println(str1[j]);
break;
}
str1[j]=str.substring(k1,k2-1);
System.out.println(str1[j]);
k+=str1[j].length();
count++;
}
for(j=0;j<=count;j++)
{
s=str1[j].substring(str1[j].indexOf(".") + 1, str1[j].indexOf(".", 4));
b[j]=s.length();
// System.out.println(b[j]);
}
BufferedReader read1=new BufferedReader(new InputStreamReader(System.in));
m=Integer.parseInt(read1.readLine());
String string="";
for(j=0;j<=count;j++){
if(m==b[j])
// System.out.println(str1[j]);
{
System.out.println(str1[j]);
string=string+" "+str1[j];
}
}
FileOutputStream fos=new FileOutputStream("bbb.txt");
OutputStreamWriter bj=new OutputStreamWriter(fos);
BufferedWriter fl=new BufferedWriter(bj);
fl.write(string);
fl.close();
}
}
up
去这看看吧,写的很详细,肯定会让你满意的
用MyEclipse 第一个菜单下面,直接有个生成.jar文件, 生成完后,再用exe4j打包即可,