北大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;
}
展开
 我来答
百度网友daaf46d89
2010-11-30 · TA获得超过1189个赞
知道小有建树答主
回答量:279
采纳率:0%
帮助的人:501万
展开全部
#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;
}
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式