P9712 题解
FurippuWRY · · 题解
一共就三点要求:
- 将题号的所有大写字母转为小写(可以使用
tolower()函数)。 - 将上一步结果的所有下划线转为减号。
- 在上一步结果前面加上
solution-。
完成这三点就可以了。
#include <bits/stdc++.h>
using namespace std;
string a;
int main() {
cin >> a;
for (int i = 0; i < a.size(); ++i) {
a[i] = tolower (a[i]);
if(a[i] == '_') a[i] = '-';
}
cout << "solution-" << a;
return 0;
}