#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], c;
// デジタル文字パターン「moji.txt」をopenする。
FILE *fpi, *fpo;
fpi
= fopen("moji.txt", "r"); if (!fpi)
{
printf("moji.txtをopen出来ません。\n"); }
// デジタル文字パターンを「moji.txt」から読み込む。
for (int b = 0; b < base; ++b)
for (int h = 0; h < height; ++h)
for (int w = 0; w < width;)
{
switch (c)
{
case '0':
num[b][h][w++] = 0;
break;
case '1':
num[b][h][w++] = 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+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCmludCBtYWluKCkKewogICAgY29uc3QgaW50IGJhc2UgPSAxNTsKICAgIGNvbnN0IGludCBoZWlnaHQgPSA1OwogICAgY29uc3QgaW50IHdpZHRoID0gMzsKICAgIGNvbnN0IGludCBvdXRsZW5ndGggPSA4OwogICAgY29uc3QgaW50IHBhdHRlcm5fbWF4ID0gNTsKICAgIGludCBudW1bYmFzZV1baGVpZ2h0XVt3aWR0aF0sIGM7CgogICAgLy8g44OH44K444K/44Or5paH5a2X44OR44K/44O844Oz44CMbW9qaS50eHTjgI3jgpJvcGVu44GZ44KL44CCCiAgICBGSUxFICpmcGksICpmcG87CiAgICBmcGkgPSBmb3BlbigibW9qaS50eHQiLCAiciIpOwogICAgaWYgKCFmcGkpCiAgICB7CiAgICAgICAgcHJpbnRmKCJtb2ppLnR4dOOCkm9wZW7lh7rmnaXjgb7jgZvjgpPjgIJcbiIpOwogICAgICAgIGV4aXQoLTEpOwogICAgfQoKICAgIC8vIOODh+OCuOOCv+ODq+aWh+Wtl+ODkeOCv+ODvOODs+OCkuOAjG1vamkudHh044CN44GL44KJ6Kqt44G/6L6844KA44CCCiAgICBmb3IgKGludCBiID0gMDsgYiA8IGJhc2U7ICsrYikKICAgICAgICBmb3IgKGludCBoID0gMDsgaCA8IGhlaWdodDsgKytoKQogICAgICAgICAgICBmb3IgKGludCB3ID0gMDsgdyA8IHdpZHRoOykKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgYyA9IGZnZXRjKGZwaSk7CiAgICAgICAgICAgICAgICBzd2l0Y2ggKGMpCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBjYXNlICcwJzoKICAgICAgICAgICAgICAgICAgICBudW1bYl1baF1bdysrXSA9IDA7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICBjYXNlICcxJzoKICAgICAgICAgICAgICAgICAgICBudW1bYl1baF1bdysrXSA9IDE7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CgogICAgLy8g5Ye65Yqb44OV44Kh44Kk44Or44KSb3BlbuOBmeOCi+OAggogICAgZnBvID0gZm9wZW4oImRhdGUudHh0IiwgInciKTsKICAgIGlmICghZnBvKQogICAgewogICAgICAgIHByaW50ZigiZGF0ZS50eHTjgpJvcGVu5Ye65p2l44G+44Gb44KT44CCXG4iKTsKICAgICAgICBleGl0KC0xKTsKICAgIH0KCiAgICAvLyA144OR44K/44O844Oz5Ye65Yqb44GZ44KL44CCCiAgICBmb3IgKGludCBwID0gMDsgcCA8IHBhdHRlcm5fbWF4OyArK3ApCiAgICB7CiAgICAgICAgLy8g5Lmx5pWw44KS5Yip55So44GX44Gf77yY44Kx44K/44Gu5paH5a2X5YiX44KS5L2c5oiQCiAgICAgICAgaW50IGJ1ZltvdXRsZW5ndGhdOwogICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgb3V0bGVuZ3RoOyArK2kpCiAgICAgICAgICAgIGJ1ZltpXSA9IHJhbmQoKSAlIGJhc2U7CiAgICAgICAgZm9yIChpbnQgaCA9IDA7IGggPCBoZWlnaHQ7ICsraCkKICAgICAgICB7CiAgICAgICAgICAgIGZvciAoaW50IGIgPSAwOyBiIDwgb3V0bGVuZ3RoOyArK2IpCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGZvciAoaW50IHcgPSAwOyB3IDwgd2lkdGg7ICsrdykKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICBpZiAobnVtW2J1ZltiXV1baF1bd10pCiAgICAgICAgICAgICAgICAgICAgICAgIGZwcmludGYoZnBvLCAi4pePIik7CiAgICAgICAgICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKGZwbywgIuOAgCIpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZnByaW50ZihmcG8sICIgIik7IC8vIOaWh+Wtl+mWk+OCkjHjg5DjgqTjg4jplovjgZHjgovjgIIKICAgICAgICAgICAgfQogICAgICAgICAgICBmcHJpbnRmKGZwbywgIlxuIik7IC8vIDHooYzjga7ntYLjgo/jgorjgIIKICAgICAgICB9CiAgICAgICAgZnByaW50ZihmcG8sICJcbiIpOyAvLyAx44OR44K/44O844Oz44Gu57WC44KP44KK44CCCiAgICB9CiAgICBmY2xvc2UoZnBpKTsKICAgIGZjbG9zZShmcG8pOwoKICAgIC8vIOODleOCoeOCpOODq+WHuuWKm+WGheWuueOCkueUu+mdouihqOekuuOBmeOCi+OAggogICAgewogICAgICAgIGNoYXIgYnVmWzEwMDBdOwogICAgICAgIGZwaSA9IGZvcGVuKCJkYXRlLnR4dCIsICJyIik7CiAgICAgICAgd2hpbGUgKGZnZXRzKGJ1ZiwgMTAwLCBmcGkpKQogICAgICAgICAgICBwcmludGYoIiVzIiwgYnVmKTsKICAgIH0KICAgIHJldHVybiAwOwp9Cg==