- 博客(8)
- 收藏
- 关注
原创 俩单链表数据交叉合并
#include <iostream.h>typedef struct LNode{int data;//数据域struct LNode *next;}LinkList; //构造一个单链表结构体void CreateList(LinkList *&L,int a[],int n){LinkList *s,*r;//s为新节点,r为尾节点L=new LNode;/...
2020-04-19 09:36:41 713
原创 数据结构顺序表c语言
#include <stdio.h>#include <malloc.h>#define MaxSize 100typedef int ElemType;typedef struct{ElemType elem[MaxSize];int length;}SqList;//定义顺序表结构体void InitList(SqList &L){L=(SqL...
2020-04-18 14:45:37 333
原创 实验一:集合类设计与实现
#include #include #include#include<stdlib.h>using namespace std;class A//自定义类{friend ostream& operator<<(ostream& os,A& c){ cout << c.data<<" ";return os;...
2020-04-11 17:45:31 873
原创 用模板实现集合类,用不同类型测试
#include #include using namespace std;class A{friend ostream& operator<<(ostream& os,A& c){ cout << c.data<<" ";return os;}friend bool operator==(A& a1, A&...
2020-03-23 00:26:25 183
原创 用继承和多态,实现一个图形系统,求动态生成的图形的面积和
#include #include using namespace std;class Shape{public:virtual int Area(){return 0;}};class Rect:public Shape{public:Rect(int m=0,int l=0){this->l=l;this->m=m;}Rect(Rect& a)...
2020-03-18 18:50:38 405
原创 C++集合类 功能:添加,修改,删除,排序,运算符重载
#include #include using namespace std;#define maxSize 5class intCla{public:/friend intCla operator+(intCla& b,intCla& c){intCla t=b;for (int i = 0; i<c.ptr; i++){ t.date[t.ptr] = c...
2020-03-18 17:58:48 1145
原创 c++菱形 输入 图案 水平间距 奇数
#include<iostream.h>int main(){int m,i,j,k,dist,d2; char c;cout<<“请输入一个奇数:\n”;cin>>m;cout<<“请输入图案:”;cin>>c;cout<<“请输入图案的水平间距:”;cin>>dist;int n1=(m+1...
2020-03-09 01:02:15 193
原创 c#学习笔记-遍历数组
遍历数组namespace 遍历数组{class Program{static void Main(string[] args){int[] data = {1, 2, 3, 4, 5};//for (int i = 0; i < data.Length; i++)//{// Console.WriteLine(data[i]); //} ...
2018-10-28 20:45:01 216
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人