アットウィキロゴ

rhhんjkk

package rank2;
 
import tool.*;
 
 
public class pro {
 int s,datanumber;
    String[] data=new String[50000];
  String[] title=new String[5000];
   int[] point=new int[50000];
      String[] artist=new String[500000];
      int dicnumber;
    String[] dic=new String[50000];
       int[] rank=new int[50000];
 
    public static void main(String[] args) {
        pro t=new pro();
    }
 
    pro(){
 
   readfile sub=new readfile();
   sub.makedata("ren.csv","UTF-8");
   data=sub.data;
   datanumber=sub.datanumber;
 
   int sx;
   int n=0;
   for(s=1;s<datanumber+1;s++){
  String[] x=data[s].split(",");
  String str="";
  if(x.length==3)str=x[2];
   String[] x1=str.split("△");
  for(sx=0;sx<x1.length;sx++){
   n=n+1;
   artist[n]=x1[sx];
   }
   }
 
 
   for(s=1;s<n+1;s++){
       int h=0;
       for(sx=1;sx<dicnumber+1;sx++){
       if(artist[s].equals(dic[sx]))h=100;
        }
       if(h<50)dicnumber=dicnumber+1;
       if(h<50)dic[dicnumber]=artist[s];
 
        }
 
   System.out.println(n); 
           System.out.println(dicnumber);   
         for(s=1;s<n+1;s++){
       for(sx=1;sx<dicnumber+1;sx++){
       if(artist[s].equals(dic[sx]))point[sx]=point[sx]+1;
        }
        }
 
 
         ranking();
 
    for(s=1;s<101;s++){
       sx=rank[s];
        System.out.println(dic[sx]+","+point[sx]);
        }
 
 
 
 
 
    }
 
 
     void ranking(){ 
 
int r,s,sx,h; 
int[] ch=new int[80000];
double maxu;
 
    for (r = 1; r < 101; r++) {
        sx = 0;
        maxu = -999999;
        for (s = 1; s < dicnumber + 1; s++) {
            h = 0;
            if (point[s] > maxu) h = h + 1;
            if (ch[s] < 50) h = h + 1;
            if (h == 2) maxu =point[s];
            if (h == 2) sx = s;
        }
        rank[r] = sx;
        ch[sx] = 100;
    }
 
 
}
 
 
}
 
最終更新:2017年07月07日 00:21