P9712 「QFOI R1」贴贴 题解
-
输出
solution-。 -
将字符串扫一遍,当为下划线时转化为减号。
-
tolower可把所有字母转小写。
最终输出字符串即可。
代码如下:
#include<bits/stdc++.h>
using namespace std;
signed main()
{
string st;
cin>>st;
cout<<"solution-";
for(int i=0;i<st.size();i++){
if(st[i]=='_')st[i]='-';
st[i]=tolower(st[i]);
}
cout<<st;
}