231 :
`:
#include <stdio.h>
#define Q 43
void main(int argc,char *argv[]){
if(argc==3){
char buf[128];
int i,j,line,m1,m2,n[6],cnt[Q][Q];
FILE *fp;
i=0;
while(i<Q){
j=0;
while(j<Q){ cnt[i][j]=0; j++; } i++; }
232 :
`:2011/05/14(土) 12:48:12.60 ID:Gsp+5y+U
fp=fopen(argv[1],"r"); line=0;
while(fgets(buf,127,fp)!=NULL){
i=9;
while(i<27){
n[i/3-3]=10*(buf[i]-48)+buf[i+1]-49; i+=3; }
i=0;
while(i<6){
j=0; m1=n[i];
while(j<6){
if(i!=j){
m2=n[j]; cnt[m1][m2]++; } j++; } i++; }
line++; }
fclose(fp);
233 :
`:2011/05/14(土) 12:50:36.06 ID:Gsp+5y+U
fp=fopen(argv[2],"w"); fprintf(fp,"#%04d\n",line);
i=0;
while(i<Q){
m1=0; fprintf(fp,"[%02d]\n",i+1);
while(m1<5){
m2=0;
while(m2<9){ j=m1+m2*5;
if(j<Q){ fprintf(fp,"%02d:%3d ",j+1,cnt[i][j]); }
m2++; }
fputs("\n",fp); m1++; }
fputs("\n",fp); i++; }
fclose(fp);
}
}