vj1230 数的朗读

Vj1230 数的朗读

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//±ÉÈ˵ķ½·¨ //·ÖÖÎ //4λһ×é´¦Àí ×î¶à3×é //ÿ×éÓÐÒ»¸öµ¥Î» ×éÖзֱðÓÐ4¸öµ¥Î» / const d1:array[0. .3] of string[1]=('Q','','S','B'); //×éÖеĵ¥Î» d2:array[1. .3] of string[1]=('','W','Y'); //ÿ×éµÄµ¥Î» var s,ans:string; f:boolean; procedure init; begin readln(s); end; procedure main; var i,j,k,l,len,p:integer; begin (*´¦ÀíСÊý²¿·Ö*) p:=pos('.',s); if (p>0) and (p<length(s)) then ans:='D'+copy(s,p+1,length(s)-p); delete(s,p,length(s)-p+1); (*´¦ÀíÇ°µ¼ ¡®+¡¯ ¡®-¡¯ ¡®0¡¯*) if s[1]='-' then begin f:=true; delete(s,1,1); end; if s[1]='+' then delete(s,1,1); while (length(s)>1) and (s[1]='0') do delete(s,1,1); if s[1]='0' then begin ans:='0'+ans; exit; end; (*·ÖÖÎ 4λһ×é*) len:=length(s); l:=len div 4+ord(len and 3<>0); //·ÖÖγ¤¶È for i:=1 to l do
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/21/2011 for the course CS 001 taught by Professor 001 during the Spring '11 term at Shandong University.

Page1 / 2

Vj1230 数的朗读

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online