アットウィキロゴ

4dee

package deracinema;
 
import java.io.*; 
 
class catchdata{ 
 
int c[][]=new int[6][6]; 
int y1[][]=new int[6][6]; 
int y2[][]=new int[6][6];     
String[] data=new String[30000];   
int s,tx,sx,datanumber,number;
String str,strx;
int s1,s2;
 
void makedata(){
 
readfile("data.txt");
 
 
for(s=1;s<datanumber+1;s++){
str=data[s];
strx=catchword(str,"husband");
s1=Integer.parseInt(strx);
strx=catchword(str,"wife");
s2=Integer.parseInt(strx);
strx=catchword(str,"c");
c[s1][s2]=Integer.parseInt(strx);
strx=catchword(str,"y1");
y1[s1][s2]=Integer.parseInt(strx);
strx=catchword(str,"y2");
y2[s1][s2]=Integer.parseInt(strx);
}
 
 
 
}
String catchword(String word,String str){
String str1,str2,strx;
int p1,p2;
str1="<"+str+">";
str2="</"+str+">";
p1=word.indexOf(str1);
p2=word.indexOf(str2);
strx="AAA";
if(p1>-1)strx=word.substring(p1,p2);
strx=strx.replace(str1,"");
return strx;
}
 
 
void readfile(String file){ 
 
String str; 
BufferedReader br;   
 
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; 
 
} 
 
 
 
 
 
} 
 
最終更新:2013年08月16日 23:49