@[ddgtang](/user/308413) ?为什么我跑了一遍是RE
by AC_Dolphin @ 2020-02-03 19:19:20
@[ddgtang](/user/308413) 你的f定义在main函数里,没初始化
by 123789456ye @ 2020-02-03 19:34:58
~~玄学变量定义法~~
by USSENTERPRISE @ 2020-02-03 19:36:54
@[123789456ye](/user/207090) f初始化了还是不行,请大佬给出进一步指示!!!
by ddgtang @ 2020-02-03 21:24:12
@[AC_Dolphin](/user/90464) 所以我才发帖子
by ddgtang @ 2020-02-03 21:28:39
@[ddgtang](/user/308413)
```cpp
#include<bits/stdc++.h>
using namespace std;
map<string, int>num;
int ans[6] = { 0 };
int main() {
int f = 0;//注意
string s;
num["one"] = 1;
num["two"] = 2;
num["three"] = 3;
num["four"] = 4;
num["five"] = 5;
num["six"] = 6;
num["seven"] = 7;
num["eight"] = 8;
num["nine"] = 9;
num["ten"] = 10;
num["eleven"] = 11;
num["twelve"] = 12;
num["thirteen"] = 13;
num["fourteen"] = 14;
num["fifteen"] = 15;
num["sixteen"] = 16;
num["seventeen"] = 17;
num["eighteen"] = 18;
num["nineteen"] = 19;
num["twenty"] = 20;
num["a"] = 1;
num["both"] = 2;
num["another"] = 1;
num["first"] = 1;
num["second"] = 2;
num["third"] = 3;
for (int i = 1; i <= 6; i++) {
cin >> s;
if (num[s] != 0) {
int p = (num[s] * num[s]) % 100;
if (p == 0)continue;
ans[f] = p;
f++;
}
//cout<<s<<endl;
}
/*cout << "F:" << f << endl;
for (int i = 0; i < f; i++) {
cout << ans[i] << endl;
}*///注意
sort(ans, ans + f);
cout << ans[0];
for (int i = 1; i < f; i++) {
if (ans[i] < 10) cout << '0';
cout << ans[i];
}
return 0;
}
```
我交了一发可过
by 123789456ye @ 2020-02-04 08:40:35
@[ddgtang](/user/308413) ~~话说你没发现跑样例多输出了一些东西吗~~
by 123789456ye @ 2020-02-04 08:41:44
@[123789456ye](/user/207090) 感谢大佬,题目已过!!!
by ddgtang @ 2020-02-04 10:33:44