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 cpp051200448061 at 2005-03-05 22:32:33 on Problem 1008
#include<iostream.h>
#include<string.h>
#include<stdlib.h>

void main()
{  int i,j,day,year,k,l,sum, number;
 char s1[19][8]={"pop", "no","zip", "zotz", "tzec"," xul", "yoxkin", "mol", 
	 "chen", "yax","zac", "ceh", "mac", "kankin", "muan","pax","koyab","cumhu","uayet"};
 char s2[20][10]={"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", 
		   "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"};
 char s3[10],day1[10];
 cin>>i;
 cout<<i<<endl;
for(j=0;j<i;j++)
{
	  cin>>day1;
	  cin>>s3;
	  cin>>year;
      for(k=0;k<19;k++)
	  {    if(strcmp(s1[k],s3)==0)
	        l=k;
	  }
	 day=atoi(day1);
	 
       sum=l*20+day+1+year*365;
	  
      year=(sum-1/260);
	  l=(sum%260)%20;
	  number=(sum%260)%13;
	 if (number==0)
		number=13;
	 if(l==0)
     l=20;
	  cout<<number<<" "<<s2[l-1]<<" "<<year<<endl;
	
}

}

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