/* io.c */ /* Last Change: 2019/07/23 (Tue) 17:17:57. */ #include #include"io.h" short int W=MAXW, H=MAXH; // (問題で設定された) 盤面サイズ上限 short int w=0, h=0; // 使用する盤面サイズ short int blocks=0; // ブロックの数 short int block_data[MAXBLOCK+1][5][3]; // ブロックの情報 short int board_data[MAXW][MAXH]; // 盤面情報 void reset_parameters(void){ int i,j,k; for(i=0;iMAXW||W<=0) printf("Error: width\n"); scanf(" %c",&c); //X scanf(" %hd",&H); if(H>MAXH||H<=0) printf("Error: height\n"); scanf(" %s",str); //BLOCK_NUM scanf(" %hd",&blocks); if(blocks<0) printf("Error: blocks\n"); for(i=1;i<=blocks;i++){ scanf(" %s",str); //BLOCK#X scanf(" %d",&x); if(x>4||x<0) printf("Error: x\n"); scanf(" %c",&c); //X scanf(" %d",&y); if(y>4||y<0) printf("Error: y\n"); nowblock=1; gets(str); for(j=0;j