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:问个问题:在最后输出的时候我用cout就会WA,但是改成printf就没问题了,这是怎么回事啊???

Posted by Trojan at 2006-05-28 22:15:23 on Problem 1008
In Reply To:问个问题:在最后输出的时候我用cout就会WA,但是改成printf就没问题了,这是怎么回事啊??? Posted by:cpp051100208084 at 2005-03-06 03:21:13
#include<iostream.h>
#include<string.h>

int main()
{
	int i,n;
	char haab[19][7]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
	char holly[20][9]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
	cin>>n;
	cout<<n<<endl;
	while(n--)
	{
		int date,year;
		long sum;
		char p[7];
		cin>>date;cin.get();cin.get();cin>>p;cin>>year;
		for(i=0;i<19;i++){if(!strcmp(p,haab[i])){sum=year*365+i*20+date;break;}}
		cout<<(sum%260)%13+1<<" "<<holly[(sum%260)%20]<<" "<<sum/260<<endl;
	}
	return NULL;
}

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