アットウィキロゴ

KHGFD

import java.io.*;

public class pro{

int s,sx,sxs,datanumber;
String[] data=new String[50000];
String[] dic=new String[50000];
String[] ske=new String[101];
String[] author=new String[1000];
String[] credit=new String[33];
int[] ndic=new int[101];
int[] ncredit=new int[33];
int dicnumber,authornumber;
int[][] num=new int[40][200];
double[][] rate=new double[40][200];
int s1,s2;
int z1;

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

pro(){        

readfile("lib.txt");

dicnumber=datanumber;

for(s=1;s<dicnumber+1;s++){
dic[s]=data[s];
}


readfile("100.txt");  

for(s=1;s<101;s++){
ske[s]=data[s];
}


for(s=1;s<101;s++){
sxs=0;
for(sx=1;sx<dicnumber+1;sx++){
if(ske[s].equals(dic[sx]))sxs=sx;
}
ndic[s]=sxs;
}

readfile("author.txt");

authornumber=datanumber;

for(s=1;s<authornumber+1;s++){
author[s]=data[s];
}

readfile("33.txt");

for(s=1;s<33;s++){
credit[s]=data[s];
}


for(s=1;s<33;s++){
sxs=0;
for(sx=1;sx<authornumber+1;sx++){
if(credit[s].equals(author[sx]))sxs=sx;
}
ncredit[s]=sxs;
}

readfile("data.txt");

for(s=1;s<33;s++){
s1=ncredit[s];
String[] x=data[s1].split(",");
for(sx=1;sx<101;sx++){
s2=ndic[sx]-1;
num[s][sx]=Integer.parseInt(x[s2]);
}
}

for(s=1;s<33;s++){
z1=0;
for(sx=1;sx<101;sx++){
z1=z1+num[s][sx];
}
for(sx=1;sx<101;sx++){
rate[s][sx]=(double)num[s][sx]/z1;
}

}






}

void readfile(String file){

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

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

}








}
最終更新:2011年06月20日 08:27