暖茶
暖茶
全部文章
题解
归档
标签
去牛客网
登录
/
注册
暖茶的博客
全部文章
/ 题解
(共5篇)
题解 | #字符串分隔#
先把数据补成8的倍数再八个一打印 #include<iostream> #include<string> using namespace std; int main() { string s; while(cin>>s) { ...
C++
字符串
2021-09-23
0
357
题解 | #计算某字母出现次数#
0.0第一时间想到的笨方法,打个卡hh #include<iostream> #include<string> using namespace std; int main() { string s; char m,n; getline(cin,s); ...
C++
字符串
2021-09-23
0
368
题解 | #字符串最后一个单词的长度#
#include<iostream> #include<string> using namespace std; int main() { string s; int pos,len; getline(cin,s); pos=s.rfind(...
C++
字符串
2021-09-22
0
339
题解 | #数字颠倒#
#include<iostream> #include<string> #include<algorithm> using namespace std; int main() { string s,m; cin>>s; for(...
C++
字符串
2021-09-22
0
408
题解 | #字符串排序#
根据题解大神稍微改了一些些= =自己太菜了,一点点测试发现大写字母减ascii码得不到小写字母QAQ,最后还是用了-('a'-'A')这种方式返回的是字母的下标,所以空格和和非字母,还有相同字母的输入顺序一并解决。比大小直接用冒泡排序加两个中间变量对比,中间变量换成相同的大小写字母,不改变原字符串字...
C++
字符串
2021-09-22
5
515