| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:问个问题:在最后输出的时候我用cout就会WA,但是改成printf就没问题了,这是怎么回事啊???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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator