Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:那组特殊数据也过了,输出格式反复对比野队了·,大佬们帮帮看看哪里有问题,一直WAIn Reply To:那组特殊数据也过了,输出格式反复对比野队了·,大佬们帮帮看看哪里有问题,一直WA Posted by:xiaoguazi0008 at 2018-02-24 18:42:05 #include<stdio.h> #include<string.h> int main() { long day,tatoldays; int N,i,j,year,month; char Haabmonth[19][10]={"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu", "uayet"}; char Tzolkinday[20][10]={"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"}; char temp[15]; scanf("%d",&N); printf("%d\n",N); while (scanf("%d. %s %d",&day,temp,&year) == 3) { tatoldays=0; for(j=0;j<19;j++) { if(strcmp(Haabmonth[j],temp)==0) break; } tatoldays=year*365+20*j+day; month=1+tatoldays%13; day=tatoldays%20; year=tatoldays/260; printf("%d %s %d\n",month,Tzolkinday[day],year); } return 0; } 这样读入数据就好了,不用for循环。 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator