北大oj 1008在线等 这段代码哪里错了 总是wa
#include<iostream>#include<string>usingnamespacestd;intmain(){stringlist[20]={"pop","...
#include <iostream>
#include <string>
using namespace std;
int main()
{
string list[20]=
{
"pop", "no", "zip", "zotz", "tzec", "xul",
"yoxkin", "mol", "chen", "yax", "zac", "ceh"
, "mac", "kankin", "muan", "pax", "koyab", "cumhu"
};
string list2[20]=
{
"ahau","imix", "ik", "akbal", "kan", "chicchan", "cimi",
"manik","lamat", "muluk", "ok", "chuen", "eb", "ben",
"ix", "mem","cib", "caban", "eznab", "canac",
};
int a;
cin >> a ;
cout << a <<endl;
int b;
char c;
string d;
int e;
while (a--)
{
d.clear();
cin >> b >>c >> d >>e;
int days=e*365+b+1;
for (int i=0; i<20; i++)
{
if (d==list[i])
{
days+=(i)*20;
break;
}
}
b=days%13;
if (b==0) b=13;
e=days%20;
int f=days/260;
cout <<b<<" "<<list2[e]<<" "<<f<<endl;
}
return 0;
} 展开
#include <string>
using namespace std;
int main()
{
string list[20]=
{
"pop", "no", "zip", "zotz", "tzec", "xul",
"yoxkin", "mol", "chen", "yax", "zac", "ceh"
, "mac", "kankin", "muan", "pax", "koyab", "cumhu"
};
string list2[20]=
{
"ahau","imix", "ik", "akbal", "kan", "chicchan", "cimi",
"manik","lamat", "muluk", "ok", "chuen", "eb", "ben",
"ix", "mem","cib", "caban", "eznab", "canac",
};
int a;
cin >> a ;
cout << a <<endl;
int b;
char c;
string d;
int e;
while (a--)
{
d.clear();
cin >> b >>c >> d >>e;
int days=e*365+b+1;
for (int i=0; i<20; i++)
{
if (d==list[i])
{
days+=(i)*20;
break;
}
}
b=days%13;
if (b==0) b=13;
e=days%20;
int f=days/260;
cout <<b<<" "<<list2[e]<<" "<<f<<endl;
}
return 0;
} 展开
1个回答
展开全部
#include <iostream>
#include <string>
using namespace std;
int main()
{
string list[20]=
{
"pop", "no", "zip", "zotz", "tzec", "xul",
"yoxkin", "mol", "chen", "yax", "zac", "ceh"
, "mac", "kankin", "muan", "pax", "koyab", "cumhu","uayet"
};
string list2[20]=
{
"ahau","imix", "ik", "akbal", "kan", "chicchan", "cimi",
"manik","lamat", "muluk", "ok", "chuen", "eb", "ben",
"ix", "mem","cib", "caban", "eznab", "canac"
};
int a;
cin >> a ;
cout << a <<endl;
int b;
char c;
string d;
int e;
while (a--)
{
d.empty();
cin >> b >>c >> d >>e;
int days=e*365+b+1;
for (int i=0; i<20; i++)
{
if (d==list[i])
{
days+=(i)*20;
break;
}
}
b=days%13;
if (b==0) b=13;
e=days%20;
int f=(days-1)/260;
cout <<b<<" "<<list2[e]<<" "<<f<<endl;
}
return 0;
}
#include <string>
using namespace std;
int main()
{
string list[20]=
{
"pop", "no", "zip", "zotz", "tzec", "xul",
"yoxkin", "mol", "chen", "yax", "zac", "ceh"
, "mac", "kankin", "muan", "pax", "koyab", "cumhu","uayet"
};
string list2[20]=
{
"ahau","imix", "ik", "akbal", "kan", "chicchan", "cimi",
"manik","lamat", "muluk", "ok", "chuen", "eb", "ben",
"ix", "mem","cib", "caban", "eznab", "canac"
};
int a;
cin >> a ;
cout << a <<endl;
int b;
char c;
string d;
int e;
while (a--)
{
d.empty();
cin >> b >>c >> d >>e;
int days=e*365+b+1;
for (int i=0; i<20; i++)
{
if (d==list[i])
{
days+=(i)*20;
break;
}
}
b=days%13;
if (b==0) b=13;
e=days%20;
int f=(days-1)/260;
cout <<b<<" "<<list2[e]<<" "<<f<<endl;
}
return 0;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询