摘要: 实际是匹配子串问题,使用STL中的string::find()和string::erase()即可,自己还动手写了一遍自己的; #include<iostream> #include<stdio.h> #include<string> using namespace std; string s; s 阅读全文
posted @ 2020-04-10 21:37 暮云林凌 阅读(162) 评论(0) 推荐(0)
摘要: 水题; #include<iostream> #include<vector> using namespace std; const int maxn = 100; int m, n, p; int m1[maxn][maxn], m2[maxn][maxn],m3[maxn][maxn]; int 阅读全文
posted @ 2020-04-10 18:43 暮云林凌 阅读(169) 评论(0) 推荐(0)
摘要: 统计每个字符子串得重复字符个数,直接利用数学问题输出坐标就可以; #include<iostream> #include<string> #include<vector> using namespace std; string s; int n; struct point { int index = 阅读全文
posted @ 2020-04-10 18:30 暮云林凌 阅读(258) 评论(0) 推荐(0)
摘要: 对一个非方阵矩阵转置; 注意转置后列变成行,行变成列; #include<iostream> #include<stdlib.h> using namespace std; const int maxn = 500; int a[maxn][maxn]; int m, n; int main() { 阅读全文
posted @ 2020-04-10 18:05 暮云林凌 阅读(279) 评论(0) 推荐(0)
摘要: 题目:一个文件中的一串数字,用逗号分割,位23.34,4242.42,343.......,要求读出并排序; 之前总结过,还是要多看看注意一下; https://www.cnblogs.com/songlinxuan/p/12370059.html 代码: #include<iostream> #i 阅读全文
posted @ 2020-04-10 17:52 暮云林凌 阅读(289) 评论(0) 推荐(0)
摘要: 问题:座位排序,对于7个人A,B,、、、G,输入7行,每一行比如 A B 6,G C -2这种表示A在B前面6排,G在C前面-2排(在C后面2排),求出这7个人从前到后顺序,最前面的是第一排,输出结果 目前没看出这个要用什么数据结构在做,个人觉得直接设定一个基准坐标,循环计算各个点的数轴位置即可; 阅读全文
posted @ 2020-04-10 12:40 暮云林凌 阅读(291) 评论(0) 推荐(0)