- 博客(16)
- 收藏
- 关注
原创 2021-04-29
JDK安装 下载JDK 双击安装并记住安装目录 配置JAVA_HOME环境变量 我的电脑–>右击–>属性 环境变量–>JAVA_HOME 配置path变量 检查安装是否成功 打开cmd输入java -version
2021-04-29 12:13:19 79
原创 2021-04-23
学习Markdown的一天 1. 标题 #+空格:代表一级标题 ##+空格:二级标题 以此类推 2.字体 粗体:前后加** 斜体:前后加* 删除线:前后加~~ 3.引用 大于号加上空格 4.分割线 —或者***回车 5.插入图片 路径可以是本地图片也可以是网站图片 6.超链接 点击查看 7.列表 :减号+空格 1.+空格 8.表格 例: |名称|单价|成本| |–|--|–| |苹果|5|2| 此时打开源代码模式将空格删除,可得: 名称 单价 成本 苹果 5 2
2021-04-23 17:12:04 71
原创 奇安信笔试
爬楼梯 #include<iostream> using namespace std; int deal(int n) { if(n==1) reutrn 1; if(n==2) return 2; return deal(n-1)+deal(n-1); } int main() { int n; while(cin>>n){ if(n<=0) cout<<0<<endl; else cout<<deal(n)<.
2020-09-02 18:34:13 281
原创 迷宫问题
有路障,多少种走法,0可走,1不可走。 #include<iostream> #include<vector> using namespace std; int main() { int n, m; while (cin >> n >> m) { int a[100][100]; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >.
2020-08-27 10:29:17 116
原创 深信服笔试
输入字符串s和n,加下来的n行分别输出a和b,将字符串中的a替换成b。 输入: 2568982543 2 2 3 5 1 输出: 3168983143 #include<iostream> #include<vector> #include<string> using namespace std; int main() { string s; int n, a, b; while (cin >> s >> n) { vector&.
2020-08-26 09:20:27 389 4
原创 趋势科技之旋转矩阵
打印旋转矩阵 输入n,在一个n*n的矩阵中,从左上角顺时针输入1,2,3…;按正常输出; 输入: 3 输出: 1 2 3 8 9 4 7 6 5 #include <iostream> #include <vector> #include<iomanip> using namespace std; vector<vector<int>> printMatrix(int n) { vector<vector<int>>
2020-08-24 17:30:22 106
原创 动态规划之最长公共子序列和最长公共子串
动态规划之最长公共子序列和最长公共子串 最长公共子序列,指两个字符串,子序列中最长的字符串。(不一定是连续字符) //最长公共子序列长度 int LCS_length(const string &str1, const string &str2,vector<vector<int>> veca) { int i, j; int biggest = 0; if (str1 == "" || str2 == "") return 0; for (i =
2020-08-07 14:33:53 96
原创 c++ primer 第十一章部分练习
练习11.7 #include <iostream> #include <string> #include <map> #include <vector> #include<iterator> using namespace std; int main() { map<string, vector<string>&g...
2019-12-30 16:22:07 120
原创 find_if一元谓词
find_if接受一元谓词,因此传递给find_if的可调用对象必须接受单一参数。 举个例子: vector<string> vec={.........}; auto wc = find_if(vec.begin(),vec.end(), [sz](const string &words){return words.size() >= sz;}); 当中的lambda...
2019-12-20 15:42:56 337
翻译 定制操作->lambda表达式
//求容器中单词字符数大于等于sz的个数及输出这些单词 #include<iostream> #include<vector> #include<string> #include<algorithm> using namespace std; //words or word string make_plural(size_t ctr, const s...
2019-12-19 20:54:50 71
原创 c++ primer第十章部分练习
练习10.9 #include<iostream> #include<vector> #include<algorithm> #include<string> using namespace std; int main() { using namespace std; void elimDups(vector<string> &...
2019-12-18 21:09:56 255
原创 vector内存管理
#include<iostream> #include<forward_list> #include<vector> int main() { using namespace std; vector<int>vec; cout << "vec:size" << vec.size() << "capacit...
2019-12-17 21:40:31 272
原创 第九章部分练习
练习9.20 #include<iostream> #include<list> #include<deque> int main() { using namespace std; list<int> ilist; deque<int>ideq1; deque<int>ideq2; int temp; while...
2019-12-17 18:58:42 63
原创 返回某字符在string对象中首次出现的位置,以及返回该字符出现的次数。
#include<iostream> #include<string> using namespace std; int main() { string::size_type find_char(const string &s, char ch, int &count); string s("woshotutxiaotaoqi"); int cnt...
2019-12-04 21:23:12 365
原创 c++ primer 第五章练习
c++ primer 5.4.1练习 输入若干string对象,查找连续出现的单词和数目。 第一种方法 #include<iostream> #include<vector> #include<string> int main() { using namespace std; int count=1; vector<string> v...
2019-12-04 15:15:54 134 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人