C++
文章平均质量分 62
IYreality
HELLO WORLD
展开
-
大一下程序设计期末大作业:[Project] Simple Circuit
答题区域成绩反馈截止时间:2018-07-08 23:59题目类型:文件上传题期末项目 --- Simple Circuit概述在高中的时候(甚至初中),我们就已经简单的接触过电路知识,也知道了与、或、非、异或等一些基础门电路知识。这一次,我们就来简单的实现一个命令行版的门电路实验程序。基础要求至少运用本学期学过的:运算符重载继承多态异常封装至少实现与、非、或、异或门要能完成基本的用户交互。比如指...原创 2018-07-12 01:01:28 · 720 阅读 · 0 评论 -
单链表的逆转
#include <stdio.h>#include <conio.h>#include<malloc.h>struct node/* 使用typedef定义类型 */{ char x; struct node * next;};node * input(){ node *p1,*p2,*h=NULL; ch...原创 2019-03-20 21:43:13 · 86 阅读 · 0 评论 -
[cstring] My memmove
[cstring] My memmove题目描述 答题区域 提交记录 成绩报告 排名情况 标准答案 相关讨论出题邮箱::卢家熙914670787@qq.com评测截止时间::实时评测2018-03-19 23:59空间限制时间限制::32MB1000msMymemmoveDescriptionImp...原创 2019-06-15 09:50:08 · 172 阅读 · 0 评论 -
动态规划专项复习
入门进阶讲的很好!!!!第一题:钢条切割问题:Serling公司购买长钢条,将其切割为短钢条出售。切割工序本身没有成本支出。公司管理层希望知道最佳的切割方案。假定我们知道Serling公司出售一段长为i英寸的钢条的价格为pi(i=1,2,…,单位为美元)。钢条的长度均为整英寸。图15-1给出了一个价格表的样例。钢条切割问题是这样的:给定一段长度为n英寸的钢条和一个价格表pi...原创 2019-06-16 12:44:25 · 245 阅读 · 0 评论 -
1020 big integer
按照题目的输出输出直接理解就是用一些互质的数作为基数表示一个很长的数字,这个很长的数字要用string或者char []表示。如果这个大数字是Int,则下面的代码就可以解决问题:#include<iostream>using namespace std;int main(){ int T,x[101]; cin >> T; w...原创 2019-06-20 14:23:48 · 122 阅读 · 0 评论 -
斯坦纳树问题
斯坦纳树典型例题https://wenku.baidu.com/view/32769df17c1cfad6195fa7a0.html状态转移方程https://www.cnblogs.com/tgycoder/p/5037559.html动态规划总结 详细原创 2019-06-16 12:44:59 · 671 阅读 · 0 评论 -
STL复习
STL用法STL教程C++ stl介绍STL注意问题STL注意事项详细解说 STL 排序(Sort)STL对比学习stack的小用法#include<iostream>#include<stack>#include<map>#include<vector>#include<queue>#i...原创 2019-06-23 18:21:20 · 115 阅读 · 0 评论 -
1021. Couples
题目:ConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionN couples are standing in a circle, numbered consecutively clockwise from 1 to 2N. Husband and wife do not always stand toget...原创 2019-06-23 18:24:22 · 112 阅读 · 0 评论 -
邻接表
#include<iostream>#include<vector>using namespace std;//第一种 -- 自己写链表struct element{ int v; element *next;};element *list[5];//假设有5个顶点,对应着5个链表//在顶点a 和 b之间添加一条边void add_edg...原创 2019-07-03 15:24:25 · 87 阅读 · 0 评论 -
排序算法集锦
效率最高的快排:#include<iostream>using namespace std;void swap(int &a,int &b){ int temp = a; a = b; b = temp;}int partition(int a[],const int low,const int high){ int key...原创 2019-06-15 09:51:37 · 59 阅读 · 0 评论 -
类class复习
分开两个文件时,比如一个是dog.cpp dog.hpp main.cppdog.hppclass dog{public :dog(){ age=1;}//不加分号int getAge();//要加分号private:int age;}dog.cpp#include"dog.hpp"int dog::getAge(){return age;...原创 2019-06-15 09:51:13 · 68 阅读 · 0 评论 -
最大子序列和的问题
一,问题描述给定(可能有负数)n个整数,求该序列连续子序列的最大值。为方便起见,若所有的整数为负数,则最大子序列和为0.也就是:在一系列整数中,找出连续的若干个整数,这若干个整数之和 最大。二,解法解法1:#include<iostream>using namespace std;void max(int *a,int n);int main(){ in...原创 2018-11-28 15:08:04 · 164 阅读 · 0 评论 -
[Inheritance]Animal & Human问题总结
一开始main.cpp里的下面两句总是报错 const human & q = h; q.greeting();报错信息:编译失败main.cpp: In function 'int main()':main.cpp:17:16: error: passing 'const human' as 'this' argument discards qualifiers [-fper...原创 2018-06-03 14:39:17 · 577 阅读 · 0 评论 -
[Classes and Objects] Inservice (eden) 虚继承
c++多重继承 和 初始化列表[Classes and Objects] Inservice (eden)题目描述答题区域提交记录成绩报告排名情况相关讨论出题邮箱::蔡桐钊1262074036@qq.com评测截止时间::实时评测2018-06-05 10:00空间限制时间限制::32MB1000msPlease complete the following 4 classes: Person, ...原创 2018-06-03 15:09:26 · 263 阅读 · 0 评论 -
[Macro/Inline Function] Try Them!
[Macro/Inline Function] Try Them!题目描述答题区域提交记录成绩报告排名情况标准答案相关讨论出题邮箱::卢家熙914670787@qq.com评测截止时间::实时评测2018-03-19 23:59空间限制时间限制::32MB1000msTry Macro and Inline FunctionDescriptionUse macro and inline funct...原创 2018-07-12 01:00:43 · 360 阅读 · 0 评论 -
[Inheritance]Collection with Inheritance (eden)
下面我贴上题目:(英语渣渣觉得能坚持读完题目的人已经是勇士了)[Inheritance]Collection with Inheritance (eden)Knowledge pointsinheritance polymorphism virtual functions interface memory management dynamic castsIntroductionTrue objec...原创 2018-07-12 01:01:06 · 378 阅读 · 0 评论 -
Algorithm]Operations on Relations
relation.cpp//// Relation.cpp// C++//// Created by 李天培 on 16/4/9.// Copyright © 2016年 lee. All rights reserved.//#include "Relation.hpp"Relation::Relation(BooleanMatrix const & m): matrix(m) {...原创 2018-07-12 01:01:51 · 149 阅读 · 0 评论 -
Algorithm]Operations on Relations
relation.cpp//// Relation.cpp// C++//// Created by 李天培 on 16/4/9.// Copyright © 2016年 lee. All rights reserved.//#include "Relation.hpp"Relation::Relation(BooleanMatrix const & m): matrix(m) {...原创 2018-07-12 01:02:11 · 156 阅读 · 0 评论 -
八大排序算法
八大排序算法总结 转载自:https://www.cnblogs.com/RainyBear/p/5258483.html排序算法可以分为内部排序和外部排序,内部排序是数据记录在内存中进行排序,而外部排序是因排序的数据很大,一次不能容纳全部的排序记录,在排序过程中需要访问外存。常见的内部排序算法有:插入排序、希尔排序、选择排序、冒泡排序、归并排序、快速排序、堆排序、基数排序等...转载 2018-11-10 15:51:36 · 114 阅读 · 0 评论 -
C++代码风格 —— 格式
转载自:https://zh-google-styleguide.readthedocs.io/en/latest/google-cpp-styleguide/formatting/ 格式每个人都可能有自己的代码风格和格式, 但如果一个项目中的所有人都遵循同一风格的话, 这个项目就能更顺利地进行. 每个人未必能同意下述的每一处格式规则, 而且其中的不少规则需要一定时间的适应, 但整个项...转载 2018-11-10 16:18:53 · 2340 阅读 · 0 评论 -
二分查找
int low = 0;int high = l.size-1;int key;cin >> key;while(low < high){ int middle = (high+low)/2; if(l[middle] == key){ cout << middle; break; } els...原创 2019-07-03 16:00:03 · 178 阅读 · 0 评论