アットウィキロゴ

hgdfcx

class ren{

String str;
String[] ph=new String[100];
String[] dic=new String[100];
int[][] mk=new int[100][100];
int[] mknumber=new int[100];
int[] np=new int[100];
String[] word=new String[100];
int[] nword=new int[100];
double[] p=new double[100];
int phnumber,dicnumber,wordnumber;
int s,sx,t;
double p1,point,maxp;
int tr;

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

ren(){

str="踊る手紙は駄目";

p[0]=1;

dicnumber=0;

for(t=1;t<10;t++){

maxp=-999;
for (tr=1;tr<11;tr++){
gen g=new gen();
g.dicnumber=dicnumber;
g.dic=dic;
g.makedata(str);
ph=g.ph;
phnumber=g.phnumber;
np=g.np;

price pr=new price();
pr.mk=mk;
pr.mknumber=mknumber;

sx=np[1];
point=p[sx];
for(s=1;s<phnumber;s++){
pr.makedata(t,np[s],np[s+1]);
p1=pr.px;
point=p1*point;
}


if(point>maxp)word=ph;
if(point>maxp)wordnumber=phnumber;
if(point>maxp)nword=np;
if(point>maxp)maxp=point;
}

for(s=1;s<wordnumber+1;s++){
if(nword[s]==0)makedic(s);
}

makep mp=new makep();
mp.wordnumber=wordnumber;
mp.dicnumber=dicnumber;
mp.word=word;
mp.nword=nword;
mp.dic=dic;
mp.p=p;
mp.makedata();
p=mp.p;

mknumber[t]=wordnumber;

for(s=1;s<wordnumber+1;s++){
if(nword[s]>0)mk[t][s]=nword[s];
if(nword[s]==0)mk[t][s]=makemk(t,s);
}

System.out.println(wordnumber);
System.out.println(maxp);

}


}

void makedic(int s){
int h;
h=0;
for(sx=1;sx<dicnumber+1;sx++){
if(word[s].equals(dic[sx]))h=100;
}
if(h<50)dicnumber=dicnumber+1;
if(h<50)dic[dicnumber]=word[s];
}

int makemk(int t,int s){
int sx,sxs;
sxs=0;
for(sx=1;sx<dicnumber+1;sx++){
if(word[s].equals(dic[sx]))sxs=sx;
}
return sxs;
}



}
最終更新:2011年05月24日 02:34