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

Re:输入格式错误哪位大牛帮忙修改一下,不胜感激!

Posted by bjss222 at 2007-04-05 20:13:20 on Problem 1008
In Reply To:输入格式错误哪位大牛帮忙修改一下,不胜感激! Posted by:vencent at 2007-03-20 23:26:31
> #include<iostream >
>  
>  using namespace std;
> int main()
> {
>     char a[19][10]={ "pop","no","zip","zotz",
> 		     "tzec","xul","yoxkin","mol",
> 		     "chen","yax","zac","ceh",
> 		     "mac","kankin","muan","pax",
> 		     "koyab","cumhu","uayet"};
> 					
> 
> 				
>     int tab_day[20]={0,20,20,20,20,
> 		     20,20,20,20,20,
> 		     20,20,20,20,20,
> 		     20,20,20,20,5};
> 
> 	char b[20][10]={"imix","ik","akbal","kan", 
> 		        "chicchan","cimi","manik","lamat",
> 		                
> 	             "muluk","ok","chuen","eb","ben",
> 	             "ix","mem","cib","caban",
> 		         "eznab"," canac","ahau"};
> 
> 	int n,m=0;
> 	cin>>n;
> 	int i,k,j,day1[1000],day2[1000],year1[1000],year2[1000];
> 	char c[1000], str[1000][20];
> 	int s[1000],t[1000];
> 	for(i=0;i<n;i++)
> 	{
> 		s[i]=0;
> 		t[i]=0;
> 	}
> 	 
> 		
> 	 
>  
> 
> 	for(i=0;i<n;i++)
> 	{	
> 		cin>>day1[i]>>c[i]>>str[i]>>year1[i];
> 		if(m==0)
> 		{	
> 			cout <<n;
>            cout<<endl;m++;
> 		}
> 
> 	   for(j=0;j<19;j++)
> 		{
> 			if(strcmp(a[j],str[i])==0)
> 			{
> 				for(k=0;k<j;k++)
> 					s[i]+=tab_day[k+1];
> 				 
> 			    s[i]+= (year1[i]*365+day1[i]);
> 			}
> 		}
> 		t[i]=s[i]%20;
> 		day2[i]=s[i]%13+1;
> 		year2[i]=s[i]/260;
>     	cout <<day2[i]<<" "<<b[t[i]]<<" "<<year2[i]  ;
>            cout<<endl;
> 	}
> 	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