class pro{
String bun;
String[] word=new String[100];
int s,wordnumber;
public static void main(String [] args) {
pro test=new pro();
}
pro(){
bun="私は猫である";
wordmaker(bun);
System.out.println(wordnumber);
for(s=1;s<wordnumber+1;s++){
System.out.println(word[s]);
}
}
void wordmaker(String bun){
int p1,s,s1,sx,h;
p1=bun.length();
sx=0;
s1=0;
for(s=0;s<p1-1;s++){
h=0;
if(Math.random()>0.5)h=100;
if(h>50)sx=sx+1;
if(h>50)word[sx]=bun.substring(s1,s+1);
if(h>50)s1=s+1;
}
sx=sx+1;
word[sx]=bun.substring(s1,p1);
wordnumber=sx;
}
}
最終更新:2011年04月22日 16:21