上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 32 下一页
摘要: 模拟大致的分母相加减的问题; 利用最大公约数和最小公倍数可以解决; 对于不同分母,求最小公倍数; 加和化简之后,采用最大公约数进行分子分母同除计算; 最小公倍数和最大公约数相关的问题之前总结过; #include<iostream> #include<string> #include<vector> 阅读全文
posted @ 2020-04-12 21:08 暮云林凌 阅读(206) 评论(0) 推荐(0)
摘要: 老生常谈的问题,留商取余; #include<iostream> #include<string> using namespace std; int n; string charge(int n) { string s=""; while (n != 0) { int r = n % 8; s = 阅读全文
posted @ 2020-04-11 17:59 暮云林凌 阅读(396) 评论(0) 推荐(0)
摘要: 没啥难度,还是难以判断测试用例的问题,也就是k是否大于10,否则就会采用字符串进行判断; #include<iostream> #include<vector> #include<queue> #include<string> using namespace std; int n, k; struc 阅读全文
posted @ 2020-04-11 17:45 暮云林凌 阅读(223) 评论(0) 推荐(0)
摘要: 实际是匹配子串问题,使用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)
摘要: 基本思想: 典型的平面最短举例点对得问题,专题总结过; 关键点: 无; #include<iostream> #include<vector> #include<algorithm> using namespace std; struct point { double x; double y; }; 阅读全文
posted @ 2020-04-09 12:26 暮云林凌 阅读(185) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 32 下一页