import java.io.*;
public class date{
String[] data=new String[50000];
String[] article=new String[50000];
String[] date=new String[50000];
int[] day=new int[50000];
int[] mon=new int[50000];
int[] year=new int[50000];
int[] num=new int[37];
int s,sx,datanumber,wordnumber,articlenumber;
String file;
String str,str1,str2;
int page,p1,p2,p3,p4;
int n,n1,n2;
int y1,m1,h;
public static void main(String[] args){
date test=new date();
}
date(){
sx=0;
for(page=1;page<46;page++){
file="memo/";
file=file+page;
file=file+".txt";
readfile(file);
for(s=1;s<datanumber+1;s++){
p1=data[s].indexOf("<");
p2=data[s].indexOf(">");
p3=data[s].indexOf("<",p2);
p4=data[s].indexOf(">",p3);
sx=sx+1;
date[sx]=data[s].substring(p1+1,p2);
article[sx]=data[s].substring(p3+1,p4);
}
}
articlenumber=sx;
for(n=1;n<articlenumber+1;n++){
String[] x=date[n].split("/");
str=x[0];
str1=str.substring(1,5);
year[n]=Integer.parseInt(str1);
str=x[1];
str1=str.substring(0,1);
str2=str.substring(1,2);
n1=Integer.parseInt(str1);
n2=Integer.parseInt(str2);
mon[n]=10*n1+n2;
str=x[2];
str1=str.substring(0,1);
str2=str.substring(1,2);
n1=Integer.parseInt(str1);
n2=Integer.parseInt(str2);
day[n]=10*n1+n2;
}
y1=2008;
m1=12;
for(s=1;s<31;s++){
m1=m1+1;
if(m1>12)y1=y1+1;
if(m1>12)m1=1;
for(n=1;n<articlenumber+1;n++){
h=0;
if(year[n]==y1)h=h+1;
if(mon[n]==m1)h=h+1;
if(h==2)num[s]=num[s]+1;
}
}
for(s=1;s<31;s++){
System.out.println(num[s]);
}
}
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;
}
}
最終更新:2011年07月07日 05:10