アットウィキロゴ

れおp

class ren{

String data,data1,data2;
String[] pop=new String[100];
int s,sx,p1,ss,pnumber;
String str;

public static void main(String [] args) {
        ren test=new ren();
            }

ren(){

readfile("data/5000.txt");

p1=data.indexOf("○");

System.out.println(p1);

data1=data.substring(0,p1);
data2=data.substring(p1-1,data.length());

String[] x=data1.split("<BR>");

ss=0;
for(s=0;s<x.length;s++){
if(x[s].indexOf("出席委員")>0)ss=s;
}

System.out.println(ss);

sx=0;
for(s=ss+1;s<x.length;s++){
if(x[s].indexOf("君")>0)sx=sx+1;
if(x[s].indexOf("君")>0)pop[sx]=x[s];
}

pnumber=sx;
for(s=1;s<pnumber+1;s++){
pop[s]=pop[s].replace(" ","△");
pop[s]=pop[s].replace("委員長","△");
pop[s]=pop[s].replace("理事","△");
}


for(s=1;s<pnumber+1;s++){
if(count(pop[s])==1)pop[s]=ch1(pop[s]);
if(count(pop[s])==2)pop[s]=ch3(pop[s]);
System.out.println(pop[s]);
}





}

String ch2(String str){
int slong;
String x2,ch;
int sx;
String[] xc=str.split("君△");
x2=xc[1];
x2=x2.replace("△","");
return x2;
}

String ch3(String str){
int slong;
String x2,ch;
int sx;
String[] xc=str.split("君△");
x2=xc[0];
x2=x2.replace("△","");
return x2;
}

String ch1(String str){
int slong,sx,h;
String ch,p1;
slong=str.length();
ch="";
for(sx=0;sx<slong;sx++){
h=0;
p1=str.substring(sx,sx+1);
if(p1.equals("△"))h=100;
if(h<50)ch=ch+p1;
}
return ch;
}



int count(String str){
int c1,c2,slong;
String z1,z2;
c1=0;
c2=0;
slong=str.length();
z1=str.substring(slong-1,slong);
if(z1.equals("君"))c1=1;
if(str.indexOf("君△")>1)c2=1;
return c1+c2;
}
void readfile(String file){

String str;
BufferedReader br;  

try {
br = new BufferedReader(new InputStreamReader(new FileInputStream(file),"SJIS"));  
while((str = br.readLine()) != null) {  
data=data+str;  
}
br.close();
} catch (IOException e) {System.out.println(e);}  

}


}
最終更新:2011年06月26日 20:25