讲义气的勇士愿offer多多
讲义气的勇士愿offer多多
全部文章
分类
归档
标签
去牛客网
登录
/
注册
讲义气的勇士愿offer多多的博客
TA的专栏
4篇文章
0人订阅
字符串操作
4篇文章
92人学习
全部文章
(共110篇)
题解 | #提取不重复的整数#
/* 思路:利用set容器来去重 1. 利用string 获得输入的字符串 2. 利用 reverse 翻转字符串 3. 创建 set<char> 容器 4. 创建结果字符串 res 5. 遍历字符串,同时检查 遍历到的字符是否在set容器中, ...
2024-10-09
1
66
题解 | #合并表记录#
/* 思路:利用map表自带的排序功能 1. 先获得输入键值对的个数 2. 获得 输入的键值对, 保存在 map 表中, 其中键值相同的数据相加 3. 遍历map表, 打印键值对 */ #include <cstddef> #include <iostre...
2024-10-09
1
61
题解 | #取近似值#
#include <iostream> using namespace std; /* 1. 用字符串 string 获得输入值 2. 找到 find函数 字符串中小数点的位置 3. 判断小数点后的 子字符串 的首字符 是否大于等于 5 4. 大于等于5 则向上取...
2024-10-09
1
65
题解 | #矩阵乘法计算量估算#
#include<iostream> #include <stack> #include <vector> using namespace std; int main(){ int res = 0; int n ; cin >&g...
2024-10-09
0
50
题解 | #二维数组操作#
#include<iostream> using namespace std; int main(){ int m,n; while(cin >> m >> n){ if(m > 9 || n > 9) ...
2024-10-06
0
80
题解 | #火车进站#
// 1. 使用全排列 next_permutation 进行操作 // 2. 使用全排列 next_permutation 前需要先进行 sort 排序操作 // 3. 使用 stack 栈 这个数据结构。 #include <algorithm> #include<iost...
2024-10-06
0
75
题解 | #24点游戏算法#
// 1. 注意数据类型要选择double // 2. 下一个全排列 next_permutation的使用 #include <algorithm> #include<iostream> #include <vector> using namespace st...
2024-10-06
0
71
题解 | #Redraiment的走法#
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vec...
2024-10-05
0
65
题解 | #字符串最后一个单词的长度#
#include <iostream> #include <vector> using namespace std; int main() { string str; vector<string> v; while(cin >&g...
2024-10-05
0
70
题解 | #字符逆序#
#include <algorithm> #include <iostream> using namespace std; int main() { string str; while(getline(cin, str)){ reverse(...
2024-10-05
0
68
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页