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了,请高手帮忙啊,急求!

Posted by lengzhigang at 2009-08-19 22:00:00 on Problem 1008
用VC测试可以,但就是WA了,不知为啥,还请高手帮忙




#include<stdio.h>
#include<string.h>

void tran(int Hday,char *q,int Hyear)
{
	int i=0,yu,Ti,Tyear,Tday;
	long int allday;
     char *mon[20]= {"imix","ik","akbal","kan","chichan","cimi","manik",
                       "lamat","mulak","ok","chuen","eb","ben","ix","mem","cib","caban",
                       "eznab","canac","ahau"};
     char *m[19]={"pop","no","zip","zotz","tzec", "xul","yoxkin","mol","chen","yax","zac",
 		"ceh","mac","kankin","muan","pax","koyab","cumhu", "uayet"};
     
		 while(strcmp(m[i],q)!=0)
                              i++;
		    allday=Hyear*365+i*20+Hday+1;
	       
	
    Tyear=allday/260;
	yu=allday%260;
       Tday=yu%13;
	Ti=yu%20;
	printf("%d %s %d\n",Tday,mon[Ti-1],Tyear);

}

int main()
{
  int a, b, Hday, Hyear;
  char p[20];
  scanf("%d",&b);
  printf("%d\n",b);
  for(a=0;a<b;a++)
  {  scanf("%d.%s%d",&Hday,p,&Hyear);
      tran(Hday,p,Hyear);

  }
  return 0;
}

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