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

运行可以,为什么老是wrong answer.我无奈了.哪位高手帮帮忙.小妹感激不尽.

Posted by 90403123 at 2004-12-17 08:56:29 on Problem 1008
#include<stdio.h> 
#include<string.h> 
void main(){ 
 int n,i,d1,k,y1,y2[10],d2[10],t=0; 
 char m[7],m3[10][8]; 
 char m1[19][7]={{'p','o','p'},{'n','o'},{'z','i','p'},{'z','o','t','z'}, 
 {'t','z','e','c'},{'x','u','l'},{'y','o','x','k','i','n'},{'m','o','l'}, 
 {'c','h','e','n'},{'y','a','x'},{'z','a','c'},{'c','e','h'},{'m','a','c'}, 
 {'k','a','n','k','i','n'},{'m','u','a','n'},{'p','a','x'}, 
 {'k','o','y','a','b'},{'c','u','m','h','u'},{'u','a','y','e','t'}}; 
 char m2[20][8]={{'i','m','i','x'},{'i','k'},{'a','k','b','a','l'}, 
 {'k','a','n'},{'c','h','i','c','c','h','a','n'},{'c','i','m','i'}, 
 {'m','a','n','i','k'},{'l','a','m','a','t'},{'m','u','l','u','k'}, 
 {'o','k'},{'c','h','u','e','n'},{'e','b'},{'b','e','n'},{'i','x'}, 
 {'m','e','m'},{'c','i','b'},{'c','a','b','a','n'},{'e','z','n','a','b'}, 
 {'c','a','n','a','c'},{'a','h','a','u'}}; 
 scanf("%d",&n); 
 for(i=0;i<n;i++){ 
  scanf("%d. %s%d",&d1,m,&y1); 
  for(k=0;k<19;k++){ 
   if(strcmp(m,m1[k])==0) 
   {t=y1*365+d1+k*20; 
   } 
  } 
  y2[i]=t/260; 
  d2[i]=t%260%13+1; 
  strcpy(m3[i],m2[t%260%20]);
  }
printf("%d\n",n); 
 for(i=0;i<n;i++){ 
  printf("%d %s %d\n",d2[i],m3[i],y2[i]);
 }
 }  
 

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