Beruflich Dokumente
Kultur Dokumente
Bi ton t mu
Uses Crt;
Const Max = !;
"i = #Tomau!$inp#;
%ar & ' &rray(1$$Max)1$$Max* o+ !$$1;
Mau),Mau ' &rray(1$$Max* o+ Byte;
-)i ' .nte/er;
0omauxu1un/)0oMauMax ' .nte/er;
2roce1ure Tao";
%ar i)3)x ' Byte;+ ' Text;
Be/in
&ssi/n4+)56; 7e8rite4+6;
7an1omi9e;
:riteln4+)Max6;
n '= Max;
"or i'=1 to n;1 1o
"or 3'=i<1 to n 1o
Be/in
x '= ran1om46;
.+ x =1 then :riteln4+)i'=)3'=6;
>n1;
Close4+6;
>n1;
2roce1ure -hap"ile;
%ar i)3 ' .nte/er;
" ' Text;
Be/in
"illChar4&)0i9eo+4&6)!6;
&ssi/n4")"i6; 7eset4"6;
7ea1ln4")-6;
:hile not >o+4"6 1o
Be/in
7ea14")i6;
:hile not eoln4"6 1o
Be/in
7ea14")36;
1
Ti liu n tp chuyn tin 11
&(i)3* '= 1; &(3)i* '= 1;
>n1;
7ea1ln4"6;
>n1;
>n1;
2roce1ure ?ien;
%ar i)3 ' .nte/er;
Be/in
:riteln;
"or i'=1 to - 1o
Be/in
"or 3'=1 to - 1o :rite4&(i)3*'=6;
:riteln;
>n1;
>n1;
2roce1ure @hoitri;
Be/in
"illChar4Mau)si9eo+4Mau6)!6;
0oMauMax '= -;
0omauxu1un/ '= 1;
Mau(1* '= 1;
>n1;
"unction @t4x)m ' .nte/er6' Boolean;A Mau m /an cho 1inh x B
Be/in
"or i'=1 to - 1o
.+ 4&(x)i*=16 an1 4m=Mau(i*6 then
Be/in @t '= "alse;>xit;>n1;
@t '= True;
>n1;
2roce1ure Tomau4x ' .nte/er6; A To mau cho 1inh x B
%ar m)luu),uumaux ' .nte/er;
Be/in
.+ x=-<1 then
Be/in
,Mau '= Mau;