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

为什么!?人生最大的痛苦就是VC上运行成功,ACM上却提交失败

Posted by huangjing1987 at 2009-08-19 22:00:30 on Problem 1008
#include<iostream>
#include<string.h>
using namespace std;
void swap(int d1,char *p1,int y1)
{
	char m2[20][9]={"imix","ik","akbal","kan","chicchan","cimi","manik",
                       "lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban",
                       "eznab","canac","ahau"};
	char m1[19][9]={"pop","no","zip","zotz","tzec", "xul","yoxkin","mol","chen","yax","zac",
 					"ceh","mac","kankin","muan","pax","koyab","cumhu", "uayet"};
	int tol,i=0;
	int d2,y2;
	int x;
	while(strcmp(m1[i],p1)!=0)
	{i++;}
	tol=y1*365+d1+i*20+1;
	y2=tol/260;
	d2=tol%13;
	x=tol%20;
	cout<<d2<<' '<<m2[x-1]<<' '<<y2<<endl;
}
int main()
{
	int i,d,y;
	char p[8],q;
	cin>>i;
	cout<<i<<endl;
	for(int j=0;j<i;j++)
	{
		
		cin>>d>>q>>p>>y;
		swap(d,p,y);
	}
	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