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

请hawk看看,我的程序老WA

Posted by realmajia at 2004-12-24 00:40:09 on Problem 1008
const
  name:array[1..19] of string=('pop','no','zip','zotz','tzec','xul','yoxkin','mol',
  'chen','yax','zac','ceh','mac','kankin','muan','pax','koyab','cumhu','uayet');
  holly:array[1..20] of string=('imix','ik','akbal','kan','chicchan','cimi','manik',
  'lamat','muluk','ok','chuen','eb','ben','ix','mem','cib','caban','eznab','canac','ahau');
var
  y1,d1,y2,d2,i,j,k,c,t,ti,p:integer;
  sum,z:longint;
  s,m1,m2,w:string;
begin
  readln(t);
  writeln(t);
  for ti:=1 to t do
    begin
      readln(s);
      p:=pos(' ',s);
      val(copy(s,1,p-2),d1,c);
      s:=copy(s,p+1,length(s)-p);
      p:=pos(' ',s);
      m1:=copy(s,1,p-1);
      s:=copy(s,p+1,length(s)-p);
      p:=pos(' ',s);
      if p<>0 then s:=copy(s,1,p-1);
      val(s,y1,c);
      z:=y1;
      sum:=365*z;
      for i:=1 to 19 do
        if name[i]=m1 then break;
      inc(sum,20*(i-1));
      inc(sum,d1+1);
      y2:=sum div 260;
      sum:=sum mod 260;
      d2:=sum mod 13;
      k:=sum mod 20;
      if d2=0 then d2:=13;
      if k=0 then k:=20;
      m2:=holly[k];
      writeln(d2,' ',m2,' ',y2);
    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