上一页 1 ··· 6 7 8 9 10 11 12 13 14 下一页
摘要: #include<iostream> using namespace std; #include<vector> #include<algorithm> //一元谓词 //仿函数 返回值类型是bool数据类型,称为谓词 //一元谓词 class GreaterFive { public: bool 阅读全文
posted @ 2021-01-16 11:33 loliconsk 阅读(314) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; //函数对象的基本使用 class MyAdd { public: MyAdd() { this->count = 0; } int operator()(int a, int b) { count++; return 阅读全文
posted @ 2021-01-16 10:26 loliconsk 阅读(107) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<string.h> int a[10000], b[10000], c[10000]; int len_a = 0, len_b = 0, len_c = 0; int main(void) { int n; scanf("%d", &n); b 阅读全文
posted @ 2021-01-15 18:58 loliconsk 阅读(188) 评论(0) 推荐(0)
摘要: 其实这道题比较简单,我们可以使用枚举,按照所给出的比例,将满足比例的三个数列举出来,然后再判断是否满足1~9都有 因为只有三个数,所以我们从1开始一直到999,然后将每一个三位数的每一位提取出来放在一个长度为10的数组中,每提取一个相应的数组位加1,最后如果数组下标1~9都是1的话就输出三个数 注意 阅读全文
posted @ 2021-01-15 09:35 loliconsk 阅读(252) 评论(0) 推荐(0)
摘要: 题解: 其实这题需要一些数学思路 首先我们来看正方形,只需要将方格放在一个以左上角为(0,0)的坐标系中,固定每个方格的右下角,那么很显然以这个方格延伸出来的正方形就是横竖坐标的最小值,其实这些坐标代表着他们的边线个数 然后我们来看长方形,长方形直接去求会很难,所以我们转换思路,矩形-正方形 = 长 阅读全文
posted @ 2021-01-14 15:32 loliconsk 阅读(156) 评论(0) 推荐(0)
摘要: 迭代器也是一种类型 迭代器的类型有iterator和 const_iterator 比如 vector<int>::iterator it //it 能读写vector<int>的元素 string::iterator it //it能读写string对象的字符 vector<int>::const 阅读全文
posted @ 2021-01-14 12:47 loliconsk 阅读(211) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; //运算符递增重载 class myint { friend ostream& operator<<(ostream& cout, myint a); public: myint() { m_a = 10; } //前置 阅读全文
posted @ 2021-01-14 12:13 loliconsk 阅读(106) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; //c++重载左移运算符 class person { friend ostream& operator<<(ostream& cout, person& p); public: person(int a, int b) 阅读全文
posted @ 2021-01-14 10:42 loliconsk 阅读(170) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; //普通函数和模板函数的区别: //1.普通函数调用可以发生类型转换 //2.函数模板 用自动类型推导 不可以发生隐式类型转换 //3.函数模板 用显示指定类型 可以发生隐式类型转换 int add01(int a, i 阅读全文
posted @ 2021-01-14 10:05 loliconsk 阅读(168) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; #include<vector> int main(void) { int n; cin >> n; string opr; string en; string gaizheng; vector<string> file 阅读全文
posted @ 2021-01-13 19:56 loliconsk 阅读(163) 评论(1) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 下一页