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 binlong at 2011-05-15 20:02:16 on Problem 1008
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

char *H[ 18 ] ={"pop","no","zip","zotz","tzec",
                   "xul","yoxkin","mol","chen","yax",
                   "zac","mac","kankin","muan","pax",
                   "koyab","cumhu","uayet"};
char *T[ 20 ] ={
    "ahau","imix","ik","akbal","kan","chicchan","cimi",
    "manik","lamat","muluk","ok","chuen","eb",
    "ben","ix","mem","cib","caban","eznab",
    "canac"};


int main( ){
  int date = 0 ,year = 0;
  char mon[ 32 ];
  int total = 0;
  int n = 0, i = 0;
  scanf( "%d", &n );
  printf( "%d\n", n );
  while( n-- ){
    scanf( "%d.%s%d",&date,mon,&year );
    for( i =0; i != 18; ++i)
       if(strcmp(mon, H[i]) == 0)
          break;
    total = date+i*20+year*365;
    printf( "%d %s %d\n",total%13+1,T[ (total+1)%20 ],total/260 );
  }
  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