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 ydlsstar at 2010-05-04 17:31:22 on Problem 1008
#include<iostream>
#include<string>
using namespace std;
int main(){

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

	int n,an;
	int count;
	int xtime;
	int ycount;
	int mcount;
	int dcount;

	cin>>n;
	an=n;
	int day[20],year[5000],d,y;
	string month[19],m;
	char c;

	for(int i=0;i<an;i++){


		cin>>d>>c>>m>>y;
		day[i]=d;
		month[i]=m;
		year[i]=y;

    }
	cout<<an<<endl;
	for(int j=0;j<an;j++){

		for(int k=0;k<19;k++){

            if(Haabmonth[k]==month[j]){

				count=k;

				break;
			}

		}

		if(count==18){

			xtime=340+day[j]+year[j]*365+1;

		}
		else{

			xtime=count*20+day[j]+year[j]*365+1;

        }
		ycount=(int)(xtime/260);
		mcount=(int)(xtime-260*ycount)%13;
		dcount=(int)(xtime%20);

	    cout<<mcount<<" "<<Tzoday[dcount-1]<<" "<<ycount<<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