#include <stdio.h>
#include <stdlib.h>
int main( )
{
const int base = 15 ;
const int height = 5 ;
const int width = 3 ;
const int outlength = 8 ;
const int pattern_max = 5 ;
int num[ base] [ height] [ width] , * p = num, c;
// デジタル文字パターン「moji.txt」をopenする。
FILE * fpi, * fpo;
fpi
= fopen ( "moji.txt" , "r" ) ; if ( ! fpi)
{
printf ( "moji.txtをopen出来ません。\n " ) ; }
// デジタル文字パターンを「moji.txt」から読み込む。
while ( ( c
= fgetc ( fpi
) ) != EOF
) {
switch ( c)
{
case '0' :
* p++ = 0 ;
break ;
case '1' :
* p++ = 1 ;
break ;
default :
break ;
}
}
// 出力ファイルをopenする。
fpo
= fopen ( "date.txt" , "w" ) ; if ( ! fpo)
{
printf ( "date.txtをopen出来ません。\n " ) ; }
// 5パターン出力する。
for ( int p = 0 ; p < pattern_max; ++ p)
{
// 乱数を利用した8ケタの文字列を作成
int buf[ outlength] ;
for ( int i = 0 ; i < outlength; ++ i)
for ( int h = 0 ; h < height; ++ h)
{
for ( int b = 0 ; b < outlength; ++ b)
{
for ( int w = 0 ; w < width; ++ w)
{
if ( num[ buf[ b] ] [ h] [ w] )
else
}
}
}
}
// ファイル出力内容を画面表示する。
{
char buf[ 1000 ] ;
fpi
= fopen ( "date.txt" , "r" ) ; while ( fgets ( buf
, 100 , fpi
) ) }
return 0 ;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCgppbnQgbWFpbigpCnsKICAgIGNvbnN0IGludCBiYXNlID0gMTU7CiAgICBjb25zdCBpbnQgaGVpZ2h0ID0gNTsKICAgIGNvbnN0IGludCB3aWR0aCA9IDM7CiAgICBjb25zdCBpbnQgb3V0bGVuZ3RoID0gODsKICAgIGNvbnN0IGludCBwYXR0ZXJuX21heCA9IDU7CiAgICBpbnQgbnVtW2Jhc2VdW2hlaWdodF1bd2lkdGhdLCAqcCA9IG51bSwgYzsKCiAgICAvLyDjg4fjgrjjgr/jg6vmloflrZfjg5Hjgr/jg7zjg7PjgIxtb2ppLnR4dOOAjeOCkm9wZW7jgZnjgovjgIIKICAgIEZJTEUgKmZwaSwgKmZwbzsKICAgIGZwaSA9IGZvcGVuKCJtb2ppLnR4dCIsICJyIik7CiAgICBpZiAoIWZwaSkKICAgIHsKICAgICAgICBwcmludGYoIm1vamkudHh044KSb3BlbuWHuuadpeOBvuOBm+OCk+OAglxuIik7CiAgICAgICAgZXhpdCgtMSk7CiAgICB9CgogICAgLy8g44OH44K444K/44Or5paH5a2X44OR44K/44O844Oz44KS44CMbW9qaS50eHTjgI3jgYvjgonoqq3jgb/ovrzjgoDjgIIKICAgIHdoaWxlICgoYyA9IGZnZXRjKGZwaSkpICE9IEVPRikKICAgIHsKICAgICAgICBzd2l0Y2ggKGMpCiAgICAgICAgewogICAgICAgIGNhc2UgJzAnOgogICAgICAgICAgICAqcCsrID0gMDsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAnMSc6CiAgICAgICAgICAgICpwKysgPSAxOwogICAgICAgICAgICBicmVhazsKICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAgICB9CgogICAgLy8g5Ye65Yqb44OV44Kh44Kk44Or44KSb3BlbuOBmeOCi+OAggogICAgZnBvID0gZm9wZW4oImRhdGUudHh0IiwgInciKTsKICAgIGlmICghZnBvKQogICAgewogICAgICAgIHByaW50ZigiZGF0ZS50eHTjgpJvcGVu5Ye65p2l44G+44Gb44KT44CCXG4iKTsKICAgICAgICBleGl0KC0xKTsKICAgIH0KCiAgICAvLyA144OR44K/44O844Oz5Ye65Yqb44GZ44KL44CCCiAgICBmb3IgKGludCBwID0gMDsgcCA8IHBhdHRlcm5fbWF4OyArK3ApCiAgICB7CiAgICAgICAgLy8g5Lmx5pWw44KS5Yip55So44GX44Gf77yY44Kx44K/44Gu5paH5a2X5YiX44KS5L2c5oiQCiAgICAgICAgaW50IGJ1ZltvdXRsZW5ndGhdOwogICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgb3V0bGVuZ3RoOyArK2kpCiAgICAgICAgICAgIGJ1ZltpXSA9IHJhbmQoKSAlIGJhc2U7CiAgICAgICAgZm9yIChpbnQgaCA9IDA7IGggPCBoZWlnaHQ7ICsraCkKICAgICAgICB7CiAgICAgICAgICAgIGZvciAoaW50IGIgPSAwOyBiIDwgb3V0bGVuZ3RoOyArK2IpCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGZvciAoaW50IHcgPSAwOyB3IDwgd2lkdGg7ICsrdykKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICBpZiAobnVtW2J1ZltiXV1baF1bd10pCiAgICAgICAgICAgICAgICAgICAgICAgIGZwcmludGYoZnBvLCAi4pePIik7CiAgICAgICAgICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKGZwbywgIuOAgCIpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZnByaW50ZihmcG8sICIgIik7IC8vIOaWh+Wtl+mWk+OCkjHjg5DjgqTjg4jplovjgZHjgovjgIIKICAgICAgICAgICAgfQogICAgICAgICAgICBmcHJpbnRmKGZwbywgIlxuIik7IC8vIDHooYzjga7ntYLjgo/jgorjgIIKICAgICAgICB9CiAgICAgICAgZnByaW50ZihmcG8sICJcbiIpOyAvLyAx44OR44K/44O844Oz44Gu57WC44KP44KK44CCCiAgICB9CiAgICBmY2xvc2UoZnBpKTsKICAgIGZjbG9zZShmcG8pOwoKICAgIC8vIOODleOCoeOCpOODq+WHuuWKm+WGheWuueOCkueUu+mdouihqOekuuOBmeOCi+OAggogICAgewogICAgICAgIGNoYXIgYnVmWzEwMDBdOwogICAgICAgIGZwaSA9IGZvcGVuKCJkYXRlLnR4dCIsICJyIik7CiAgICAgICAgd2hpbGUgKGZnZXRzKGJ1ZiwgMTAwLCBmcGkpKQogICAgICAgICAgICBwcmludGYoIiVzIiwgYnVmKTsKICAgIH0KICAgIHJldHVybiAwOwp9Cg==
compilation info
prog.c: In function 'main':
prog.c:12:40: error: initialization from incompatible pointer type [-Werror]
int num[base][height][width], *p = num, c;
^
cc1: all warnings being treated as errors
stdout