- 博客(14)
- 收藏
- 关注
原创 蓝桥杯冲冲!!!! 计蒜客总结
EOF的巧用 EOF自身特点 一直读 读到文件尾 如 what a nice day 读到空格时就会再进行一次 while循环 ,然后 又输入了一遍 会覆盖之前的输入 所以到最后只会剩下 day#include<iostream>#include<cstring>#include<cstdio>using namespa...
2019-03-04 12:07:09
531
1
转载 转!!!基姆拉尔森计算公式(计算某天是星期几的模板)
What day is itTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4916 Accepted Submission(s): 1446Problem DescriptionToday is Saturday, 17...
2019-01-30 18:24:00
387
原创 C prime plus 里的例题代码
cerr 一般用来输出错误信息然后打开一个文件 ,写入内容,关闭(保存) ,再打开输出 //命令行处理技术 p772//以下命令打开程序未命名3 #include<iostream>#include<cstdlib>#include<fstream>int main(int argc,char *argv[]){using na...
2018-12-03 21:22:43
981
原创 近期 做的c++练习题
C Prime plus课后练习 5-7 5 - 7#include<iostream>#include<cstring>using namespace std;typedef struct{ string name; int year; }car;int main(){ cout << "How many do u wish...
2018-12-03 21:15:00
338
原创 个人最近做的动态规划大型总结!!!
首先大多数题的套路(搬运至大佬,见水印) 最长回文子序列:字符串反转+动态规划,最长公共子序列LCS算法题目思想大概是这样:cabbeaf:回文子序列有:c,a,aa,bb,,aba,abba,e,f,最长的就是abba,所以输出长度为4#include<iostream>#include<algorithm>#include<cst...
2018-10-09 14:31:56
205
原创 动态规划 01背包问题 和 求最大升序
求最大升序先求出 每一个为起点时(从后向前)最大的升序数列 将数列保存到dp中 再遍历dp求出最大值#include<iostream>#include<algorithm>#include<cstring>using namespace std;const int MAXSIZE=1000;int pai(int arr[],i...
2018-09-26 19:45:25
201
原创 第三章 总结
\a 为响铃\b 回退一个字符const Typename name = value;EX: const int months = 12; cout.self ( ios_base :: fixed, ios_base :: floatfield);显示小数点后六位cout 一般会直接忽略结尾 0;EX: 333.25000 cout 显示为 333.25co...
2018-09-17 19:45:20
297
原创 C prime plus 第三章
#include<iostream>using namespace std;int main(){ cout << "\aOperation \"HyperHype\" is now acrivated!\n"; cout << "Enter your code________\b\b\b\b\b\b\b\b"; long code; cin&am
2018-09-17 19:20:26
399
原创 偷偷关注
#include<stdio.h>#include<string.h>#include<iostream>#include<algorithm>#include<math.h>#include<set>#include<map>using namespace std;struct node{
2018-09-17 19:05:19
250
原创 快速幂
算法老师的第一题快速幂用 for循环来的too late所以用这个公式 a^b mod c == (a mod c)^b mod c#include &amp;lt;stdio.h&amp;gt;int Power(int, int);const int MOD = 10007;int main(){ int N, k; scanf(&quot;%d%d&quot;, &amp;amp;
2018-09-13 15:45:45
186
原创 第二章收获
第二章题都很基础,但莫名给自己出个几个坑 第一题cin不能输入空格的问题 gets()函数顺利解决 关于第二题 一开始以为要用C++字符串转数字 在优快云上找到了大佬的解法 https://blog.youkuaiyun.com/qq_34870631/article/details/78899467...
2018-09-12 20:30:51
145
原创 C Prime plus 第二章 编程题
第一题这里写代码片#include<iostream>#include<string> using namespace std;int main(){ char m[20]; char n[20]; cout<<"your name:\n"; gets(m); cout<<"your adre...
2018-09-12 20:26:43
362
原创 用递归求数组中最大数
/*求不带头结点的单链表L中的所有结点之和*/int sum(Lnode *L){ if(L = NULL) return 0; else return L->data+sum(L->data); } /*求二叉树中bt所有结点之和*/int sumbt(BTNode = bt){ if(bt->lchild == NULL...
2018-09-12 20:20:08
616
原创 2018.9.7 stl sort 排序 vector顺序容器
STL sort排序这里写代码片#include<iostream>#include<algorithm>using namespace std;int main(){ int a[] = {2,5,4,1,3}; sort(a , a+5); for(int i = 0; i < 5; i++ cout<<...
2018-09-07 17:52:34
185
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅