- 博客(15)
- 收藏
- 关注
原创 蓝桥杯冲冲!!!! 计蒜客总结
EOF的巧用 EOF自身特点 一直读 读到文件尾 如 what a nice day 读到空格时就会再进行一次 while循环 ,然后 又输入了一遍 会覆盖之前的输入 所以到最后只会剩下 day#include<iostream>#include<cstring>#include<cstdio>using namespa...
2019-03-04 12:07:09 470 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 331
原创 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 701
原创 近期 做的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 236
原创 2018.12.3 杂谈
瞎比写的 啊,距离上次更博有一个月了⑧,上个月考完了算法考试和程序员考试,然后好久没有敲代码,感觉学的一点点算法又都还回去了。。。对了自从LGD输了以后就自闭了,然后快2个月没有打dota2,最近又安排上了诶。。果然还是忘不了,王者荣耀也上了王者,哎,最近玩的真的多,临近期末要学习了,不然最后一个星期又通宵补。爸妈都不在家一个月,周末不能回家了略无聊,国家啥时候给我分配女朋友?最...
2018-12-03 20:58:12 93
原创 个人最近做的动态规划大型总结!!!
首先大多数题的套路(搬运至大佬,见水印) 最长回文子序列:字符串反转+动态规划,最长公共子序列LCS算法题目思想大概是这样:cabbeaf:回文子序列有:c,a,aa,bb,,aba,abba,e,f,最长的就是abba,所以输出长度为4#include<iostream>#include<algorithm>#include<cst...
2018-10-09 14:31:56 160
原创 动态规划 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 150
原创 第三章 总结
\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 244
原创 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 343
原创 偷偷关注
#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 194
原创 快速幂
算法老师的第一题快速幂用 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 134
原创 第二章收获
第二章题都很基础,但莫名给自己出个几个坑 第一题cin不能输入空格的问题 gets()函数顺利解决 关于第二题 一开始以为要用C++字符串转数字 在CSDN上找到了大佬的解法 https://blog.csdn.net/qq_34870631/article/details/78899467...
2018-09-12 20:30:51 101
原创 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 285
原创 用递归求数组中最大数
/*求不带头结点的单链表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 537
原创 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 127
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人