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 244480909 at 2007-05-19 20:29:40 on Problem 1008
#include<stdio.h>
#include<string.h>
main(){
int i=0,n,month2,day,year1,day1;
long int year,sum;
char month[10],month1[10];
char Ma[][10]={"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh",
               "mac", "kankin", "muan", "pax", "koyab", "cumhu","uayet"};
char Tz[][10]={"ahau","imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok",
              "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac"};

scanf("%d",&n);
while(n){
scanf("%d.%s%d",&day,&month,&year);
for(i=0;i<=18;i++){ if (strcmp(Ma[i],month)==0) break;
}
sum=365*year+i*20+day+1;

year1=sum/260;
day1=sum%13;
month2=sum%20;
printf("%d %s %d\n",day1,Tz[month2],year1);
}

}

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