home *** CD-ROM | disk | FTP | other *** search
- uses dos,crt,slova,matika;
-
- var sfs,a,rad,kus1,kus2,kus3: string;
- aa,bb:text;
- i,lo,j,k,l,m,code,n : integer;
- st,dt,jt : array [0..9] of String[20];
- znak : char;
-
- begin { NA ZKOUSKU }
-
- lo:=0;
-
- st[1]:='sto';
- st[2]:='dvêstê';
- st[3]:='t⌐ista';
- st[4]:='çty⌐ista';
- st[5]:='pêtset';
- st[6]:='¿estset';
- st[7]:='sedmset';
- st[8]:='osmset';
- st[9]:='devêtset';
- st[0]:='';
-
- dt[1]:='deset';
- dt[2]:='dvacet';
- dt[3]:='t⌐icet';
- dt[4]:='çty⌐icet';
- dt[5]:='padesát';
- dt[6]:='¿edesát';
- dt[7]:='sedmdesát';
- dt[8]:='osmdesát';
- dt[9]:='devadesát';
- dt[0]:='';
-
- jt[1]:='jeden';
- jt[2]:='dva';
- jt[3]:='t⌐i';
- jt[4]:='çty⌐i';
- jt[5]:='pêt';
- jt[6]:='¿est';
- jt[7]:='sedm';
- jt[8]:='osm';
- jt[9]:='devêt';
- jt[0]:='';
-
- sfs:=fsearch('c:\trell\convert.dll',GetEnv('path'));
- if not(sfs='') then
- begin
-
- assign(aa,'c:\trell\convert.dll');
- reset(aa);
- readln(aa,rad);
- close(aa);
-
- {
- readln(rad);
- }
-
- rad:= soucet(rad,'0');
- if not(rad='chyba') then
- begin
-
- { writeln(rad); }
-
- j:=0;
- for i:=1 to ord(rad[0]) do
- begin
- if rad[i]=',' then j:=1;
- end;
- if j=1 then rad:= des_et(rad,'2');
-
- { writeln(rad); }
-
- j:=0;
- kus1:='';
- kus2:='';
- for i:=1 to ord(rad[0]) do
- begin
- if j=1 then kus2:=kus2+rad[i];
- if rad[i]=',' then j:=1;
- if j=0 then kus1:=kus1+rad[i];
- end;
-
- {
- writeln(kus1);
- writeln(kus2);
- }
-
- kus1:=prelej(kus1);
- kus3:='';
- j:=0;
- for i:=1 to ord(kus1[0]) do
- begin
- kus3:=kus3+kus1[i];
- if i/3 = int(i/3) then
- begin
- if i>2 then
- begin
- kus3:=kus3+'.';
- j:=j+1;
- end;
- end;
- end;
-
- kus3:=prelej(kus3);
- if kus3[1]='.' then
- begin
- rad:='';
- for i:=2 to ord(kus3[0]) do rad:=rad+kus3[i];
- j:=j-1;
- kus3:=rad;
- end;
-
- k:=ord(kus1[0]);
-
- kus1:='';
- for i:=1 to ord(kus3[0]) do
- begin
- if not(kus3[i]='.') then kus1:=kus1+kus3[i]
- else
- begin
- if j=2 then kus1:=kus1+'M';
- if j=1 then kus1:=kus1+'T';
- j:=j-1;
- end;
- end;
-
- { writeln(kus1); }
-
- m:=1;
- rad:='';
- for i:=1 to ord(kus1[0]) do
- begin
-
- j:=k;
- while j>3 do j:=j-3;
- val(kus1[i],l,code);
- if code=0 then
- begin
- if j=3 then rad:=rad+st[l];
- n:=0;
- if j=2 then
- begin
- lo:=1;
- if l=1 then
- begin
- val(kus1[i+1],l,code);
- if l=0 then rad:=rad+'deset';
- if l=1 then rad:=rad+'jedenáct';
- if l=2 then rad:=rad+'dvanáct';
- if l=3 then rad:=rad+'t⌐ináct';
- if l=4 then rad:=rad+'çtrnáct';
- if l=5 then rad:=rad+'patnáct';
- if l=6 then rad:=rad+'¿estnáct';
- if l=7 then rad:=rad+'sedmnáct';
- if l=8 then rad:=rad+'osmnáct';
- if l=9 then rad:=rad+'devatenáct';
- k:=k-1;
- i:=i+1;
- n:=1;
- end
- else rad:=rad+dt[l];
- end;
-
- if k<3 then jt[1]:='jedna';
- if j=1 then rad:=rad+jt[l];
- k:=k-1;
-
- {
-
- writeln(l);
- writeln(j);
- writeln(k);
- writeln(rad);
-
- }
-
-
- end { pro code=0 }
- else
- begin
-
- if (lo=1) and (kus1[i]='T') then m:=5;
-
- if not((m=2)or(m=3)or(m=4)) then
- begin
- if kus1[i]='M' then rad:=rad+'milión';
- if kus1[i]='T' then rad:=rad+'tisíc';
- end
- else
- begin
- if n=0 then
- begin
- if kus1[i]='M' then rad:=rad+'milióny';
- end
- else
- begin
- if kus1[i]='M' then rad:=rad+'miliónû';
- end;
- if kus1[i]='T' then rad:=rad+'tisíce';
- end;
-
- if kus1[i]='M' then lo:=0;
- if kus1[i]='T' then lo:=0;
-
- {
-
- writeln(l);
- writeln(j);
- writeln(k);
- writeln(rad);
-
- }
-
-
- end; { pro code=1 }
- m:=l;
- end;
-
- rad:=rad+'korun';
-
- if rad='korun' then rad:='';
- if rad='jednakorun' then rad:='jednakoruna';
- if rad='dvakorun' then rad:='dvêkoruny';
- if rad='t⌐ikorun' then rad:='t⌐ikoruny';
- if rad='çty⌐ikorun' then rad:='çty⌐ikoruny';
-
- if not(kus2='') then
- begin
- if not(rad='') then rad:=rad+' ';
-
- m:=1;
- k:=2;
-
- for i:=1 to ord(kus2[0]) do
- begin
-
- j:=k;
- while j>3 do j:=j-3;
- val(kus2[i],l,code);
- if code=0 then
- begin
- if j=3 then rad:=rad+st[l];
- n:=0;
- if j=2 then
- begin
- if l=1 then
- begin
- val(kus2[i+1],l,code);
- if l=0 then rad:=rad+'deset';
- if l=1 then rad:=rad+'jedenáct';
- if l=2 then rad:=rad+'dvanáct';
- if l=3 then rad:=rad+'t⌐ináct';
- if l=4 then rad:=rad+'çtrnáct';
- if l=5 then rad:=rad+'patnáct';
- if l=6 then rad:=rad+'¿estnáct';
- if l=7 then rad:=rad+'sedmnáct';
- if l=8 then rad:=rad+'osmnáct';
- if l=9 then rad:=rad+'devatenáct';
- k:=k-1;
- i:=i+1;
-
- end
- else rad:=rad+dt[l];
- end;
- if j=1 then rad:=rad+jt[l];
- k:=k-1;
- end; { pro code=0 }
-
- m:=l;
- end;
- rad:=rad+'halé⌐û';
-
- end; { pro kus2 }
-
- znak:=upcase(rad[1]);
- if znak='¿' then znak:='¢';
- if znak='ç' then znak:='Ç';
- rad[1]:=znak;
-
- {
- writeln(rad);
- readln;
- }
-
- rewrite(aa);
- writeln(aa,rad);
- close(aa);
-
- end; { pro chybu }
- end;
- end.