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

也是输入有问题,c++是不会自动过滤整数后面那个“.”的

Posted by hawk at 2004-02-25 00:31:13 on Problem 1008
In Reply To:那位高手能帮我看看,为什么老是Wrong answer!谢谢!万分感谢! Posted by:C0400348073 at 2004-02-24 23:16:41
> #include<iostream.h>
> #include<string.h>
> void main()
> {
> 	int count,year,day,j,y,num,name;
> 	long int All_day;
> 	char *m[19]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax",
> 		"zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
> 	char *n[20]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok",
> 		"chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
> 	char month[10];
> 	cin>>count;
> 	cout<<count<<endl;
> 	for(int i=0;i<count;i++)
> 	{
> 		cin>>day;
> 		cin>>month;
> 		cin>>year;
> 		for(j=0;j<19;j++)
> 		{
> 			if(strcmp(month,m[j])==0)
> 				break;
> 		}
> 		All_day=year*365+j*20+day;
> 		y=(All_day+1)/260;
> 		num=All_day%13+1;
> 		name=All_day%20;
> 		cout<<num<<" "<<n[name]<<" "<<y<<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