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

写丑了啊。。。==但是不知道哪里wa了。。。数据都过了orz大神们求教

Posted by Advantage at 2012-01-31 22:45:30 on Problem 1008
我知道代码很丑很恶心==。。。但是。。。如果有心情神马的话还是帮忙看看吧。。。。雪地裸身跪谢~~!!!!

program ljf;
const
	h:array[1..18]of string=('pop', 'no', 'zip', 'zotz', 'tzec', 'xul', 'yoxkin', 'mol', 'chen', 'yax', 'zac', 'ceh', 'mac', 'kankin', 'muan', 'pax', 'koyab', 'cumhu');
        t: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
	tt,i,j,hyear,tyear,hday,tday,hmonth,tmonth,year,month,day:longint;
        s:string;
        c:char;
procedure deal;
var
	sum:longint;
begin
	hyear:=0;
        tyear:=0;
        hday:=0;
        tday:=1;
        hmonth:=1;
        tmonth:=1;
        sum:=1;
        while not((hyear=year)and(hday=day)and(hmonth=month)) do begin
        	inc(hday);
                if (hmonth=19)and(hday=5) then begin
                	inc(hyear); hmonth:=1; hday:=0;
                end else if (hmonth<>19)and(hday=20) then begin
                	inc(hmonth); hday:=0;
                end;
                inc(tday); inc(tmonth);
                inc(sum);
                if tmonth=14 then tmonth:=1;
                if tday=21 then tday:=1;
                if (sum=261) then begin
                	inc(tyear); tmonth:=1; tday:=1; sum:=1;
                end;
        end;
end;
procedure print;
begin
	writeln(tmonth,' ',t[tday],' ',tyear);
end;
procedure readin;
begin
	readln(tt);
        for i:=1 to tt do begin
        	s:='';
        	read(c);
                while c<>' ' do begin s:=s+c; read(c); end;
                s:=copy(s,1,length(s)-1);
                val(s,day,j);
                s:='';
                read(c);
                while c<>' ' do begin s:=s+c; read(c); end;
                month:=19;
                for j:=1 to 18 do if h[j]=s then begin month:=j; break end;
                readln(year);
                deal;
                print;
        end;
end;
begin
	readin;
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