Home > Back-end >  Acm a very simple question, a great god and see what is wrong
Acm a very simple question, a great god and see what is wrong

Time:09-27

Title in this: http://acm.tju.edu.cn/toj/showp1002.html, I input and output and the problem is the same, but the submission has been showed wrong answer, also didn't see what the problem ah, strives for the great god teach,,,
#include
#include
#include
using namespace std;
Char a [19] [7]={" pop ", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "Chen", "yax," "zac," "ceh", "MAC", "kankin", "muan," "pax", "koyab", "cumhu", "uayet"};
Char b [20] [9]={" imix ", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen," "eb", "Ben", "ix", the "mem", "cib", "caban", "eznab", "canac", "ahau"};
Int devert (int y, char [], m. float d)
{
Int I, ii;
For (I=0; i<19. I++)
{
If (STRCMP (m, a [I])==0)
break;
}
Ii=int (d);
Return 365 + I * y * 20 + 2 + 1;
}
Int main ()
{
Int I, n, y, sum, YEAR, DAY, num=0, k=0;
Float d;
Int the save [100000]={0};
Char m [7], the MONTH [9].
Cin & gt;> n;
I=n;
While (n -)
{
Cin & gt;> D & gt;> M & gt;> y;
Sum=devert (y, m, d);
The save [num++]=sum;
}
coutWhile (+ + n!=I)
{
Sum=save [n].
YEAR=sum/260;
Strcpy (MONTH, b [sum % 260% 20-1));
DAY %=sum 13;
If (sum %==0 13 & amp; & The sum!=0)
DAY=13;
cout}
return 0;
}
  • Related