Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

PE Need Help

Posted by xt at 2005-07-13 15:27:00 on Problem 1102
Program PKU1102;
Const
  LCDNum:Array['0'..'9',1..7] Of 0..1=((1,1,1,0,1,1,1),(0,0,1,0,0,1,0),
  (1,0,1,1,1,0,1),(1,0,1,1,0,1,1),(0,1,1,1,0,1,0),(1,1,0,1,0,1,1),
  (1,1,0,1,1,1,1),(1,0,1,0,0,1,0),(1,1,1,1,1,1,1),(1,1,1,1,0,1,1));
Var
  S,I,J:Byte;
  T:Char;
  C:String;
  P:String;
Procedure WriteN(C:Char;Times:Byte);
  Var
    I:Byte;
  Begin
    For I:=1 To Times Do P:=P+C;
  End;
Procedure DelSpace;
  Begin
    While P[Length(P)]=' ' Do Begin
      P:=Copy(P,1,Length(P)-1);
    End;
  End;
Begin
  While True Do Begin
    ReadLn(S,T,C);
    If S=0 Then Break;
    P:='';
    For I:=1 To Length(C) Do Begin
      P:=P+' ';
      If LCDNum[C[I],1]=1 Then WriteN('-',S)
      Else WriteN(' ',S);
      P:=P+' ';
    End;
    DelSpace;
    WriteLn(P);
    For J:=1 To S Do Begin
      P:='';
      For I:=1 To Length(C) Do Begin
        If LCDNum[C[I],2]=1 Then P:=P+'|' Else P:=P+' ';
        WriteN(' ',S);
        If LCDNum[C[I],3]=1 Then P:=P+'|' Else P:=P+' ';
      End;
      DelSpace;
      WriteLn(P);
    End;
    P:='';
    For I:=1 To Length(C) Do Begin
      P:=P+' ';
      If LCDNum[C[I],4]=1 Then WriteN('-',S)
      Else WriteN(' ',S);
      P:=P+' ';
    End;
    DelSpace;
    WriteLn(P);
    For J:=1 To S Do Begin
      P:='';
      For I:=1 To Length(C) Do Begin
        If LCDNum[C[I],5]=1 Then P:=P+'|' Else P:=P+' ';
        WriteN(' ',S);
        If LCDNum[C[I],6]=1 Then P:=P+'|' Else P:=P+' ';
      End;
      DelSpace;
      WriteLn(P);
    End;
    P:='';
    For I:=1 To Length(C) Do Begin
      P:=P+' ';
      If LCDNum[C[I],7]=1 Then WriteN('-',S)
      Else WriteN(' ',S);
      P:=P+' ';
    End;
    DelSpace;
    WriteLn(P);
    WriteLn;
  End;
End.
求助......

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator