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

谁能帮我看一下1009题哪里错了????

Posted by flyingpengfei at 2007-05-27 15:21:58
#include<stdio.h>
#include<string.h>

void convert(void)
{
int i,NumberOfTheDay,year,month2,sumdays,temp1,temp2,ab;
char month1[10];
const char *Month1[]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
const char *Month2[]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
scanf("%i. %s %i",&NumberOfTheDay,month1,&year);
temp1=strcmp(month1,Month1[18]);
if(temp1==0)
{
	sumdays=year*365+NumberOfTheDay+360;
    month2=sumdays%20;
   if((sumdays+1)%13==0)
     printf("%i %s %i\n",13,Month2[month2],sumdays/260);
   else
     printf("%i %s %i\n",(sumdays+1)%13,Month2[month2],sumdays/260);
goto end;
}

for(i=0;i<18;i++)
{
	temp2=strcmp(month1,Month1[i]);
     if(temp2==0)
	 {ab=i;
     break;}
	 else continue;
}
sumdays=year*365+NumberOfTheDay+i*20;
month2=sumdays%20;
if((sumdays+1)%13==0)
     printf("%i %s %i\n",13,Month2[month2],sumdays/260);
else
printf("%i %s %i\n",(sumdays+1)%13,Month2[month2],sumdays/260);
end:;
}




int main(void)
{ 
long int j,N;
void convert(void);
scanf("%ld\n",&N);
for(j=0;j<N;j++)
convert();
}


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