来人呐,帮我修改一下
原题链接:119233.༺ཌༀ 神印༒王座 ༃ༀད༻2026-06-04 16:40:11
发布于:浙江
#include <bits/stdc++.h
using namespace std;
typedef long long ll;
// 存每个字母对应的基础攻击
ll get_base(char ch)
{
if(ch == 'a') return 999999999999999LL;
if(ch == 'b') return 808080;
if(ch == 'c') return 789191;
return 0; //d/e无效
}
int main()
{
string line[1005]; //存所有王座行
int cnt = 0;
string s;
ll mul;
// 循环读行,直到读到纯数字(最后一行倍率)
while(getline(cin, s))
{
// 判断是不是全数字(倍率行)
bool isnum = true;
for(auto c:s)
{
if(!isdigit(c)){isnum = false;break;}
}
if(isnum)
{
mul = stoll(s);
break;
}
line[cnt++] = s;
}
// 逐行处理输出
for(int i=0;i<cnt;i++)
{
string str = line[i];
char id = str[0];
if(id == 'd' || id == 'e')
{
cout << id << endl;
continue;
}
// 找到冒号位置,拆分后面数字
size_t pos = str.find(":" ); //注意:冒号是中文
string num_str = str.substr(pos+1);
ll use = stoll(num_str);
ll base = get_base(id);
// 拼接输出
cout << str.substr(0,pos+1) << base << "" << use << "" << mul << endl;
}
return 0;
}
这里空空如也




















有帮助,赞一个