Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses crt;
- type
- chu=(khong,mot,hai,ba,bon,nam,sau,bay,tam,chin);
- var
- s:string;
- n:longint;
- procedure ghichu(i:longint);
- var k:longint;
- begin
- k:=ord(s[i])-48;
- if (k<>0) or (i<>3) then write(chu(k),' ');
- end;
- function chuyen(i:longint):longint;
- begin
- exit(ord(s[i])-48);
- end;
- procedure solve();
- begin
- readln(n);
- str(n,s);
- n:=length(s);
- if n=1 then ghichu(1)
- else
- begin
- if n=2 then s:='0'+s;
- if chuyen(1)<>0 then
- begin
- ghichu(1);
- write('tram ');
- end;
- if chuyen(2)<>0 then
- begin
- ghichu(2);
- write('muoi ');
- if chuyen(3)=5 then write('lam')
- else ghichu(3);
- end
- else
- begin
- if chuyen(3)<>0 then write('le ');
- ghichu(3);
- end;
- end;
- end;
- begin
- solve();
- readln();
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement