![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
笔记
文章平均质量分 57
赤城封雪
这个作者很懒,什么都没留下…
展开
-
【数据结构】排序
排序 简单排序算法 冒泡排序算法 基本思想是,将待排序的数组看成竖着排列的气泡,键值较小的元素较轻而上浮。 typedef int item; void sort(item a[],int l,int r) { for(int i=l+1;i<=r;i++){ for(int j=i;j>l;j--){ // 第i遍处理时,不必检查第i高以上的元素 if(a[j-1]>a[j])swap(a[j-1],a[j]); } } } 简单插入排序算法 基本思原创 2021-11-15 23:14:38 · 139 阅读 · 0 评论 -
7-3 时间模拟
#include <iostream> #include <string> #include <math.h> #include <stdio.h> using namespace std; class Time{ //时间基类 public: int second; int minute; int hour; Time(int h=0,int mi=0,int s=0) //构造函数 :hour(h),minute原创 2021-06-13 12:53:28 · 356 阅读 · 0 评论