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

帮忙看看

Posted by 13032688526 at 2007-07-19 11:35:33
#include"stdio.h"
#include <string.h>
int main()
{ long int leaveday;
  int t,n,i,j,pday,lday,pyear,lyear,sumday;
  char pmonth[10];
  char p[19][10]={"pop","no","zip","zotz","tzec","xul", "yoxkin",
	     "mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
  char l[20][10]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk",
	     "ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
  scanf("%d",&n);
  printf("%d\n",n);
  for(t=0;t<n;t++)
  {  scanf("%d.%s%d",&pday,pmonth,&pyear);
     i=0;
	 while(strcmp(pmonth,p[i]))
	    i++;
	 sumday=pyear*365+i*20+pday+1;
	 lyear=sumday/260;
	 leaveday=sumday%260;
	 if(leaveday%20==0)
		 j=19;
	 else j=leaveday%20-1;
	 
	 if(leaveday%13!=0)
		lday=leaveday%13;
	 else lday=13;
	 
	 printf("%d %s %d\n",lday,l[j],lyear);
  }
  return 0;
}

为什么老是wrong answer

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