アットウィキロゴ

SDF

import java.io.*;

class pro{

int s,sx,datanumber,articlenumber,cnumber;
String[] data=new String[10000];
String[][] credit=new String[500][10000];
int[] creditnumber=new int[500];
String[] creditdic=new String[10000];
String file;
int n,no,year;
int n1,t,h;
int[] rank=new int[2000];

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

pro(){

t=0;

for(year=13;year<20;year++){

n1=makenum(year);

for(n=1;n<n1+1;n++){

t=t+1;

no=100*year+n;

file="credit/";
file=file+no;
file=file+".txt";

readfile(file);

for(s=1;s<datanumber+1;s++){
String[] x=data[s].split(",");
credit[t][s]=x[1];
}
creditnumber[t]=datanumber;

}
}

articlenumber=t;
cnumber=0;

for(t=1;t<articlenumber+1;t++){
for(s=1;s<creditnumber[t]+1;s++){
h=0;;
for(sx=1;sx<cnumber+1;sx++){
if(credit[t][s].equals(creditdic[sx]))h=100;
}
if(h<50)cnumber=cnumber+1;
if(h<50)creditdic[cnumber]=credit[t][s];
}
}


makerank();


for(s=1;s<201;s++){
sx=rank[s];
System.out.println(creditdic[sx]);
}



}

void makerank(){
int[] num=new int[2000];
int[] ch=new int[2000];
int sxs,h,maxn,r;

for(t=1;t<articlenumber+1;t++){
for(s=1;s<creditnumber[t]+1;s++){
sxs=0;
for(sx=1;sx<cnumber+1;sx++){
if(credit[t][s].equals(creditdic[sx]))sxs=sx;
}
num[sxs]=num[sxs]+1;
}
}

for(r=1;r<1001;r++){
maxn=0;
sxs=0;
for(sx=1;sx<cnumber+1;sx++){
h=0;
if(num[sx]>maxn)h=h+1;
if(ch[sx]<1)h=h+1;
if(h==2)maxn=num[sx];
if(h==2)sxs=sx;
}
ch[sxs]=r;
rank[r]=sxs;
}

}

int makenum(int year){
int mk;
mk=35;
if(year==13)mk=35;
if(year==14)mk=42;
if(year==15)mk=30;
if(year==16)mk=35;
if(year==17)mk=31;
if(year==18)mk=31;
if(year==19)mk=10;
return mk;
}

void readfile(String file){

String str;
BufferedReader br;
int s;
s=0;

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

}

}
最終更新:2011年06月04日 23:52