| ||||||||||
| 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:为什么大家给的测试数据都通过了,但还是WA。。。。。。。。。高手帮帮忙!!!In Reply To:为什么大家给的测试数据都通过了,但还是WA。。。。。。。。。高手帮帮忙!!! Posted by:flyingpengfei at 2007-10-11 18:29:53 > #include<iostream>
> #include<cstring>
> #include<cstdlib>
> using namespace std;
>
> void convert(void)
> {
> long int i,NumberOfTheDay,month2,sumdays,temp1,temp2,ab;
> int year;
> char month1[10];
> char c;
> const char *Month1[]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
> const char *Month2[]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
> cin>>NumberOfTheDay>>c>>month1 >>year;
> temp1=strcmp(month1,Month1[18]);
> if(temp1==0)
> {
> sumdays=year*365+NumberOfTheDay+361;
> month2=sumdays%20;
> if(sumdays%13==0)
> cout<<13<<" "<<Month2[19-month2]<<" "<<(sumdays-1)/260<<endl;
> else
> cout<<sumdays%13<<" "<<Month2[19-month2]<<" "<<(sumdays-1)/260<<endl;
> goto end;
> }
>
> for(i=0;i<18;i++)
> {
> temp2=strcmp(month1,Month1[i]);
> if(temp2==0)
> {ab=i;
> break;}
> else continue;
> }
> sumdays=year*365+NumberOfTheDay+i*20+1;
> month2=sumdays%20;
> if(sumdays%13==0)
> cout<<13<<" "<<Month2[month2-1]<<" "<<sumdays/260<<endl;
> else
> cout<<sumdays%13<<" "<<Month2[month2-1]<<" "<<sumdays/260<<endl;
> end:;
> }
>
>
> int main()
> {
> long int j,N;
> void convert(void);
> cin>>N;
> for(j=0;j<N;j++)
> convert();
> return 0;
> }
>
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator