package check;
import tool.*;
import java.io.*;
public class pro {
int s,datanumber;
String[] data=new String[9000];
int[][] point=new int[9000][53];
public static void main(String[] args) {
pro t=new pro();
}
pro(){
readfile sub7=new readfile();
sub7.makedata("data.csv","UTF-8");
data=sub7.data;
datanumber=sub7.datanumber;
int sx;
for(s=2;s<datanumber+1;s++){
String[] x=data[s].split(";");
for(sx=1;sx<51;sx++){
point[s-1][sx]=numx(x[sx-1]);
}
}
for(s=1;s<datanumber;s++){
int z=0;
int sxs=1;
for(sx=2;sx<50;sx++){
if(point[s][sx]>point[s][sx-1])sxs=sx;
}
int n1=point[s][sxs-1];
int n2=point[s][sxs];
int n3=point[s][sxs+1];
if(sxs>1)point[s][sxs]=(n3+n1)/2;
}
writexml("ren.csv");
}
int numx(String str){
int nx;
nx=0;
try{
nx=Integer.parseInt(str);
}catch (Exception e) {}
return nx;
}
void writexml(String file){
int s,sx;
try{
PrintWriter pw = new PrintWriter (new BufferedWriter(new FileWriter(file)));
pw.print("1位");
for(sx=2;sx<51;sx++){
pw.print(",");
pw.print(sx);
pw.print("位");
}
pw.println("");
for(s=1;s<datanumber;s++){
pw.print(point[s][1]);
for(sx=2;sx<51;sx++){
pw.print(",");
pw.print(point[s][sx]);
}
pw.println("");
}
System.out.println("ファイルに書きこみました。");
pw.close();
} catch(IOException ep){ System.out.println("入出力エラーです。"); }
}
}
最終更新:2016年07月07日 01:46