排序
【递归】反转链表
/** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNode* reverseList(struct ListNode* head) { stru...
【深基2.习6】Apples Prologue / 苹果和虫子
题目描述 八尾勇喜欢吃苹果。她现在有m(1<=m<=100)个苹果,吃完一个苹果需要花费 t(0<=t<=100)分钟,吃完一个后立刻开始吃下一个。现在时间过去了s(1<=s<=10000)分钟,...
【C++】使用cpp-httplib库实现http通讯
下载 GitHub:https://github.com/yhirose/cpp-httplib 仅需下载头文件httplib.h后导入至项目中即可,非常简单 服务端 现在以我的个人通讯录管理系统项目中的云端备份功能为例,简单的讲解这个...
【C++】自定义泛型Vector类
代码 #prlagma once #include <iostream> using namespace std; template <typename T> class MyVector { private: // 指向动态分配的数组 T* base; // 容器容量 int capacity; // 当前元...
【C++】四舍五入
#include <iostream> #include <cmath> using namespace std; float a[100000]; int main(){ int n; cin >> n; for (int i=0;i<n;i++){ cin >> a[i]; } for (int i=0;i<n;i++){ cou...