![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
笔记
文章平均质量分 79
Zforw
这不过是将来之事的前奏,也是将来之事的影子
展开
-
2020/12/18第三次上机
T1 #include<iostream> using namespace std; class Fraction { //数据成员,访问控制属性默认是私有 int m_numerator = 0; // 分子默认为0; C++11 int m_denominator = 1; //分母默认为1; public://公有成员函数 Fraction(int above = 0, int below = 1) : m_numerator(above), m_denom原创 2020-12-18 20:52:15 · 169 阅读 · 1 评论 -
面向对象
真∙面向对象 Object Oriented Programming class class_name { instance varibles public: member_functions private: ... }; class_name obj_name()//generate_function obj_name.xxx 特性 继承 区别于Java,可以继承多个类 class C:public A,public B { }; 封装 多态 接口 class Base.原创 2020-12-15 22:23:17 · 121 阅读 · 1 评论 -
排序
排序算法 冒泡排序 O(n^2) 通过比较来交换相邻的两个数,每一次遍历一定会将当前范围内最大的移动到最后(如果是最大的,每一比较相邻的两个元素它都是最大值,逃不掉的)。 称做冒泡的原因:越小的元素会经由交换慢慢“浮”到数列的首端,就如同水中的气泡最终会上浮到顶端一样。 //Increase void bubble_sort(int a[],int l,int r) { for(int i = l;i < r;++i) { for(int j = i;j <=原创 2020-12-11 20:13:38 · 119 阅读 · 0 评论 -
2020/11/11第一次上机题目
一、排序 // // Created by 赵丰 on 2020/11/11. // #include<iostream> #include<cmath> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; if(a > b){ if(a < c){ int t = c; c = a;原创 2020-11-11 19:34:34 · 1139 阅读 · 5 评论