
C++
文章平均质量分 87
超级码力奥
这个作者很懒,什么都没留下…
展开
-
LeetCode 2353. 设计食物评分系统 维护哈希表+set
哈希表,C++中的set——平衡树原创 2022-07-30 23:07:28 · 451 阅读 · 0 评论 -
《C++实战小练》**03:容器Vector的使用(四)
前言 容器作为C++的一种数据类型,其动态操作和给定的几个函数都极大地方便了我们,今天我们做一下他的练习题 题目 代码 #include <iostream> #include <ctime> #include <cstdlib> #include <vector> #include <algorithm> #include <numeric> using namespace std; struct student { int原创 2020-05-14 12:09:59 · 154 阅读 · 0 评论 -
《C++实战小练》**03:容器Vector的使用(三)
前言 容器作为C++的一种数据类型,其动态操作和给定的几个函数都极大地方便了我们,今天我们做一下他的练习题 题目 代码 #include <iostream> #include <ctime> #include <cstdlib> #include <vector> #include <algorithm> #include <numeric> using namespace std; struct student { int原创 2020-05-14 12:05:15 · 192 阅读 · 0 评论 -
《C++实战小练》**03:容器Vector的使用(二)
前言 容器作为C++的一种数据类型,其动态操作和给定的几个函数都极大地方便了我们,今天我们做一下他的练习题 题目 代码 #include <iostream> #include <ctime> #include <cstdlib> #include <vector> #include <algorithm> using namespace std; struct student { int number; double score; };原创 2020-05-14 12:00:59 · 169 阅读 · 0 评论 -
《C++实战小练》**03:容器Vector的使用(一)
前言 容器作为C++的一种数据类型,其动态操作和给定的几个函数都极大地方便了我们,今天我们做一下他的练习题 题目 代码 #include <iostream> #include <ctime> #include <cstdlib> #include <vector> #include <algorithm> using namespace std; class test { private: int n; vector<i原创 2020-05-14 11:57:35 · 255 阅读 · 0 评论 -
《C++实战小练》**02:运算符重载实例(四)
前言 其实运算符重载这一块大家还是忽略了他的重要性。熟练地掌握运算符重载可以更好地理解类的概念,更好地使用。 题目 注意这里又一个数组头指针赋值的操作。 代码 #include <iostream> #include <cstdlib> #include <vector> using namespace std; class test { private: int n; vector<int> a; public: test(in原创 2020-05-12 14:56:41 · 254 阅读 · 0 评论 -
《C++实战小练》**02:运算符重载实例(三)
前言 其实运算符重载这一块大家还是忽略了他的重要性。熟练地掌握运算符重载可以更好地理解类的概念,更好地使用。 题目 注意这里的重载函数返回类型是布尔型。 代码 #include <iostream> using namespace std; class test { protected: int x1, y1, x2, y2; public: test() { x1 = 0; y1 = 0; x2 = 0;原创 2020-05-12 14:50:47 · 160 阅读 · 0 评论 -
《C++实战小练》**02:运算符重载实例(二)
前言 其实运算符重载这一块大家还是忽略了他的重要性。熟练地掌握运算符重载可以更好地理解类的概念,更好地使用。 题目 其实本质上就是向量相加,注意要对两个运算符重载。 源码 #include <iostream> #include<cstdlib> using namespace std; class test { protected: int x1, y1, x2, y2; public: test() { x1 = 0;原创 2020-05-12 14:46:09 · 111 阅读 · 0 评论 -
《C++实战小练》**02:运算符重载实例(一)
前言 其实运算符重载这一块大家还是忽略了他的重要性。熟练地掌握运算符重载可以更好地理解类的概念,更好地使用。 题目 思路很清晰,只需要记住基本的格式就可以。 源码 #include <iostream> #include <cstdlib> using namespace std; const double PI = 3.1415926; class test { protected: int x, y; double r; public: test(in原创 2020-05-12 14:37:57 · 180 阅读 · 0 评论 -
《C++实战小练》**01:简单类的使用
前言 鉴于大家在初学面向对象这一概念时对于类的理解不太深刻,作为一名正在面向对象的大一学生,特意为大家分享我的C++练习题目,并附上源码注释,希望大家可以关注我,一起学习,一起进步。有什么可以改进优化的地方欢迎大家及时私信我,也可以关注我的公众号。一起加油噢,我现在也是蒟蒻一枚。 题目 思路很清晰,关键是怎么写到类里去。在这里我一般把这个问题就看做一个类,这样其实直接在类里写solution就完全...原创 2020-05-08 11:46:08 · 330 阅读 · 2 评论